The 'Refresh Metadata' button in the Actions dropdown already provides
the ability to re-trigger source image downloads. Updated documentation
to reflect this.
Add two mechanisms to ensure source images are downloaded:
1. Trigger SourceMetadataStorageWorker when media_profile_id changes,
so if a user switches to a profile with download_source_images enabled,
the images will be fetched.
2. After successful indexing, check if source images are missing but
should exist (profile has download_source_images: true). If so,
kick off the metadata storage worker to download them.
This fixes issues where sources created before download_source_images
was added, or sources that had failed metadata jobs, never got their
artwork downloaded.
Add rescue block to SourceDeletionWorker to handle cases where the
source no longer exists. This prevents infinite retries when a deletion
job fails and the source has already been removed from the database.
Configure SQLite busy_timeout PRAGMA to 5000ms so queries wait for
locks to be released instead of failing immediately. This prevents
Oban job queue from getting stuck with 'Database busy' errors during
concurrent operations.
Include :executing in the unique states list for both FastIndexingWorker
and MediaCollectionIndexingWorker. This ensures Oban properly tracks
executing jobs and prevents potential duplicate job issues.
Without :executing in the unique states, the uniqueness check doesn't
consider currently running jobs, which could lead to jobs not appearing
in the UI's active tasks view or duplicate jobs being scheduled.
After each successful indexing run, the source's download_cutoff_date is
automatically advanced to 7 days ago if the current cutoff date is older
(or nil). This prevents yt-dlp from scanning through months of old videos
on every index run, significantly improving indexing performance for
channels with large backlogs.
The 7-day buffer ensures recent videos are still checked on subsequent
index runs while keeping indexing fast (minutes instead of hours).
Also updates AGENTS.md to document Docker-based development workflow
and adds Pinchflat_improvements.md for tracking known issues.