pocket-casts-ios icon indicating copy to clipboard operation
pocket-casts-ios copied to clipboard

Resume downloads on next launch after force quit

Open jgcaruso opened this issue 2 years ago • 0 comments

Fixes #472

This PR adds a check for episodes in the downloading status that aren't actually downloading, and re-adds them to the queue. This is performed when other "resume download" logic is run in checkForPendingAndAutoDownloads

To test

  1. pull branch and build
  2. start downloading an episode
  3. once the download has started, force quit the app
  4. reopen the app and browse to the episode again (or check the Profile -> Downloads section)
  5. The episode should have auto resumed download

NOTE: currently, the download resumes from 0% since there doesn't appear to be any download progress state saved. Also, it might not be desirable to resume from the existing file's position since this download could resume several days later which might cause issues with playback due to auto ad insertion.

NOTE 2: I tested in an iOS 14.1 simulator prior to applying this branch, and downloads didn't resume there either, so it doesn't appear that they ever resumed if no code changes have been made around this recently... or at least, its not the result of a fundamental change to iOS.

Checklist

  • [x] I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • [ ] I have considered adding unit tests for my changes.
  • [ ] I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

jgcaruso avatar Nov 04 '22 20:11 jgcaruso