android
android copied to clipboard
Only Download Necessary Files
trafficstars
- [x] Tests written, or not not needed
Problem
Downloaded files are re-downloading, and notifications appear for files that have already been downloaded. The sync should only trigger downloads for new or editable files, as media files cannot be changed.
The two-way sync triggers the FileDownloadWorker every 15 minutes. If a folder contains multiple files, even if all files are already downloaded, the worker will still show notifications for each file and attempt to re-download them again.
Note: Images can be edited, but any edited image will create a copy rather than modifying the original file. Thus, no need to download original image.
Changes
- Download only files that haven't been downloaded and aren't media files.
- Return early if requestDownloads is empty.
Demo
https://github.com/user-attachments/assets/88505d08-654b-4a4b-821c-0c622970dec8