Open makhalaf opened 1 year ago
⚡ Sweep Free Trial: I used GPT-3.5 to create this ticket. You have 0 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal.To get Sweep to recreate this ticket, leave a comment prefixed with "sweep:" or edit the issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
safaribooks.py |
- In the _start_multiprocessing method, after line 82, add the following code:```python if os.path.isfile(os.path.join(self.BOOK_PATH, self.book_id + ".epub")): self.display.log("Book already exists: %s" % self.book_id) return ``` |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Add check to skip book download if book already exists
sweep/check-book-existence
Description
This PR adds a check to skip the book download process if the book already exists in the specified output directory. This helps to avoid unnecessary downloads and saves resources.
Summary
- Added a check to see if the EPUB file already exists in the specified output directory.
- If the file exists, the download process is skipped and a log message is displayed.
- This check is implemented in the
_start_multiprocessing
method insafaribooks.py
.
File | Instructions | Progress |
---|---|---|
safaribooks.py |
- In the _start_multiprocessing method, after line 82, add the following code:python<br/> if os.path.isfile(os.path.join(self.BOOK_PATH, self.book_id + ".epub")):<br/> self.display.log("Book already exists: %s" % self.book_id)<br/> return<br/> | ✅ Commit 3872391 |
I have finished coding the issue. I am now reviewing it for completeness. |
Here are the my self-reviews of my changes at sweep/check-book-existence
.
Here is the 1st review
No changes required. The code changes in
safaribooks.py
on lines 1121-1122 are correct and do not contain any errors.
I finished incorporating these changes.
To recreate the pull request, leave a comment prefixed with "sweep:" or edit the issue. Join Our Discord
check if book exist skip book download