-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enqueue fixes: 1) option to enqueue after currently playing 2) respect download start order #2714
Conversation
Review guide: this PR contains 2 separate but related issues. They are grouped together as they same many common codes. Main commits are:
|
892f5b7
to
e1a068d
Compare
rebased with the latest |
The fix for respecting download start order (issue #2006) also has an unintended side effect. It fixes #1250 (Resume incomplete download) in many cases. Specifically, for episodes that can be auto-downloaded (the default unless users change the podcast preference), with this PR, AntennaPod will automatically resume their downloads (if they have been incomplete). Details: with this PR (fixing #2006),
Catch:
Users can understand what's happening if they look at the downloads log: |
e643fb9
to
66bde44
Compare
The PR has been rebased against |
core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
Outdated
Show resolved
Hide resolved
core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java
Outdated
Show resolved
Hide resolved
...rc/main/java/de/danoeh/antennapod/core/storage/FeedFileDownloadStatusRequesterInterface.java
Outdated
Show resolved
Hide resolved
@ByteHamster Thanks for taking the time to review the PR. |
66bde44
to
64f0dd2
Compare
Review feedback all incorporated. |
This also closes #2283 |
Not sure if this is worth changing it but there is currently a difference to the version before this PR. When cancelling a download in progress, it does not get to the queue. With this PR, it stays in the queue, I think. |
You're correct: With this PR, an episode does stay in the queue if its download is cancelled. So is the case if the download fails.
Thoughts? |
Good argument. Would it be possible (without too much additional code) that cancelling the download manually does not keep the item in the queue? I sometimes accidentally download the wrong episode and then cancel the download after a second. |
On undoing the enqueuing when user cancels a download: the change will be a tad messy, as it involves propagates the needed states across multiple layers. Outline:
|
(Regression fixed) Also, I realize there is an regression that first needs to be fixed: The PR as-is ignores the user settings "Enqueue Downloaded": the changed codes always enqueue them. (I totally forget there is such settings!) |
I believe the only open issue is when an user cancels a download, whether the item should be removed from the queue (if it's enqueued by download). The implementation option I outlined in #2714 (comment) would be somewhat messy. Here is a cleaner alternative, but it requires tracking of download states at the
Thoughts? |
What about storing the state in the downloadRequest? I did not look into this a lot but maybe the request can have a flag to remove from queue if it's cancelled. |
Storing the state in the downloadRequest is essentially the first approach in #2714 (comment) It has its own messiness:
|
Hmm okay, you are right, that's quite a nasty change. Maybe we can just keep the episodes for now and see if users complain... |
I have used the feature for 1+ year, and have not really bothered by it. I did recall I had encounter it a few times (that I have to remove the canceled episode from the queue) but it didn't really register in my mind until you pointed it out. It might be my own blind spot though. Another idea: at code level, the problem is that download logic is split between
|
That actually sounds like a good refactoring. Also makes DBTasks a bit smaller. Just noticed another requirement that we need to keep in mind: when canceling a download but the episode was in queue already, it should not be removed. |
…generic DownloadStateProvider.
- replaced existing enqueue at front - the option after current episode will replace Keep In-Progress in Queue that was in the PR (30f104f).
ce2178d
to
89d7670
Compare
The latest commits:
From my side, the PR is ready to be merged. |
Thanks for this huge PR. Let's hope that this does not break something. It would be great if you could make a PR for removing cancelled downloads (as mentioned in #2714 (comment)) before the next release (take your time, the next release will probably not be too soon). |
@ByteHamster Thanks for taking the time to review / merge. The PR for handling cancel download is there. I also added a couple more PR / issue that are related to the use cases for this PR. |
I noticed another behavior change caused by this PR. When downloading manually from the episodes » new screen, AntennaPod previously displayed the download status and the episode went away after downloading. Now, pressing download instantly removes the episode from the new screen. In my opinion, this is quite confusing because you don't see if the download was actually started. Technically, I know that the download is started when the episode vanishes but it's still confusing to me. So it's probably even more confusing to users who have not read this PR. |
I think what matters is what make an episode not new anymore and what triggers new flag removal.
Still what adding to queue manually should do? Right now it's considered as "add to queue and remove new flag". |
This behavior is fixed now.
I also think this is fine. The way I interpret the "new" flag is like the "unread" flag for emails. If you interact with the episode (stream, download, add to queue, etc), the flag should be removed. |
Closes #2448, #2006 (I think they are the same thing)
I think #2652 can be closed as well - it has 2 separate use cases. One is addressed here, the other one is part of feed priority use cases in #2437.
closes #2283