-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
More predictable Downloader::startDownload() #1052
Conversation
Before this change `Downloader::startDownload()` might avoid starting a new download when a download with the specified URI was already present in its cache. This might be confusing for the following reasons: 1. uri is not the only parameter of `Downloader::startDownload()` - a target download directory may also be specified through the second `options` parameter. Thus calling `Downloader::startDownload()` twice with the same URI but different download directories would not save files into the second directory. 2. Files of a completed download may be removed, whereupon downloading the same files again won't be a no-op. However in such a situation `Downloader` refuses to actually repeat a previous download.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1052 +/- ##
==========================================
+ Coverage 39.36% 39.42% +0.05%
==========================================
Files 58 58
Lines 4075 4069 -6
Branches 2245 2243 -2
==========================================
Hits 1604 1604
+ Misses 1091 1085 -6
Partials 1380 1380 ☔ View full report in Codecov by Sentry. |
How aria2's I feel a bit unconfident about simply remove this check (even if I agree with you description). |
@veloman-yunkan What is the status of this PR? Does last comment of @mgautierfr has triggered a difficulty? |
@kelson42 No additional technical difficulties. As I wrote in the description I was not sure that the proposed change was a good idea and @mgautierfr's feedback was along the same lines. Yet I will keep it open for a while until I decide how to proceed. |
I started working on an alternative solution based on introducing a new method |
I like better #1066. At least we are "sure" that aria2 will not misbehave when we have two downloads for the same file/option. |
OK, it seems an alternative has been chosen, but the two issues this PR was going to fix are still open:
So not sure if this PR should be revamped, a new PR started or just the two issue to be closed... |
Fixes kiwix/kiwix-desktop#1022 (as well as the other case described in #1050 without fixing the latter)
Before this change
Downloader::startDownload()
might avoid starting a new download when a download with the specified URI was already present in its cache. This might be confusing for the following reasons:uri is not the only parameter of
Downloader::startDownload()
- a target download directory may also be specified through the secondoptions
parameter. Thus callingDownloader::startDownload()
twice with the same URI but different download directories would not save files into the second directory.Files of a completed download may be removed, whereupon downloading the same files again won't be a no-op. However in such a situation
Downloader
refuses to actually repeat a previous download.This change is sufficient to fix the bugs described in #1050 without any changes in
kiwix-desktop
. However I am not sure that it is the right way to do that - maybe adding aremoveDownload()
function tokiwix::Downloader
(and thus fixing #1050) is justified in any case.