Skip to content

download_covers: add a new downloader and thumbnail generator. (no filemonitors)

nee requested to merge nemuii/podcasts:new-downloader-no-filemonitor into main

I'm opening this for some feedback, since I'm not sure how to move forwards myself.

I have 3 branches of the new downloader (which one is the best way to go?).

  1. branch with file monitors
  2. this branch
  3. no-filemonitors branch, but it uses the external image crate for thumb generation.

Small changes I'm considering on this branch (are these worth implementing?):

  • Drop the CoverImage widget again. It doesn't hold any data in the no-filemonitors branches and creates a adw::Bin wrapper only to call 1 function.
  • Have some kind of weak reference stored in COVER_DL_REGISTRY as a lock, so drop_dl_lock doesn't need to be called.
  • Some kind of meaningful lock for failed cover downloads to avoid too many retries.
  • Cache full-sized textures on hidpi resolutions above 2.0 scaling.
  • use the fractional-dpi-scale-value you can get form a Surface to determine the right thumbnail to use.
  • Maybe replace the sleeping with a broadcaster or tokio::watch sync.

Big changes I would like, but I don't know how to implement:

  • Move the thumbnailer into a different process
  • Use glycin for image loading. (maybe only during import and thumb generation?)
  • Write a test case that will not hang when waiting for the MAINCONTEXT loop to advance.

I would like to aim for a minimal acceptable version that can be merged, so we can make a release with improved performance for mobile soon.

Merge request reports