#1506·photoview

Discover albums in a queued job instead of on the scan request

Author: try-and-succeedCreated Sep 22, 2026Updated Sep 22, 2026

Is your feature request related to a problem? Please describe. Queueing a scan walks the directory tree on the GraphQL request itself. AddUserToQueue calls scanner.FindAlbumsForUser, and the single-album rescan in #1491 calls scanner.FindAlbumsForAlbum in the same way. Each one stats and reads every directory below the root, creates or updates the album rows, and only queues jobs after that. On a large or slow library (network share, spinning disk) the "Scan" button's request can run for a long time, and a proxy timeout can cut it off even though the work continues.

Describe the solution you'd like A "discover" job type in the scanner queue. The mutation only queues one discovery job for the root (user root or album) and returns straight away. A worker then walks the tree and queues one scan job per album found, the way the request does today. The existing queue machinery (concurrency limit, one live job per album, cancellation from #1492) then covers the discovery as well.

Describe alternatives you've considered Running the current discovery in a goroutine and returning early. That's simpler, but it's invisible to the queue status and can't be cancelled, and two clicks could start two walks of the same tree.

Additional context Raised as a known limitation in the scanner PRs (#1491, #1492, and the split-up #1484). It predates them: the full-library scan has always done this. It's a change to the job model, so it seemed better as its own discussion than folded into either PR.