Repository navigation
Description
What happened
After a library scan adds or removes titles, a server smart collection's card keeps showing the old title count to admins and other accounts with no library or rating limits, for up to an hour. The collection's members are already right: opening it lists the new titles. Only the number on the card, in the Collections page, the library Collections tab and the admin list, is stale. Profiles with a limit see the correct count straight away, because theirs is computed fresh.
Steps to reproduce
- As an admin, create a server smart collection whose rule matches titles that a scan will add, for example "Added in the last 7 days".
- Add a new title to one of its libraries and let the scan finish.
- As the admin, open Collections: the card shows the old count. Open the collection: the new title is there.
- Sign in as a profile with a rating limit or restricted libraries: its card shows the new count.
On a local sandbox of build 2072 · 4018816da, after adding two titles to a library, the smart collection's card read 1 title for the admin account and for an unrestricted regular account, while both listed 3 titles inside it; a regular account with restricted libraries saw 3 on the card and a PG profile saw 2 (agent runtime testing, confirmed by the maintainer by hand as the admin).
Expected behavior
A smart collection's count matches its members for every viewer soon after a scan changes the libraries it draws from, not only on the periodic refresh.
Silo version / commit
Build 2072 · 4018816da (latest main on 2026-11-09).
Deployment
Not recorded.
Area
Libraries, scanning, and metadata
Clients affected
- Web UI
- Android
- iOS/tvOS/macOS
- Jellyfin-compat client (Infuse, Findroid, ...)
- Other/not client-specific
Client app and device
Web UI in a desktop browser. The apps read the same item_count from the API, so they show the same stale number to unrestricted viewers.
Relevant logs
None.
Technical notes
Unrestricted viewers get the stored library_collections.item_count_cached. PR #2835 made restricted viewers count live and left unrestricted ones on the stored value ("a smart collection's cached count can be an hour old"). SmartCountRefresher (internal/catalog/smart_count_refresher.go) updates that value shortly after startup, then hourly (internal/api/router.go), and for one collection when an admin creates or edits it (refreshSmartCountAsync in internal/api/handlers/admin_collections_service.go). Nothing refreshes it when a scan adds or removes titles.
Possible fixes: refresh the stored counts of smart collections that draw from a library when a scan of that library changes its titles (debounced, so a large scan doesn't refresh repeatedly), or count unrestricted viewers live too, as restricted viewers already are. Open PR #2728 also edits smart_count_refresher.go and how counts are read, so the two should be coordinated.
Validation: Collections Server #193 S4 (smart rules reflect changes to library contents), Web admin #194 A2, Web #195 W4, and the client tasks' C4, parent #192, AC3. Blocking, by maintainer decision on 2026-11-09.
AI harness
Claude Code
AI tool(s)
GitHub CLI, Git
AI model(s)
Claude Opus 5.5 (claude-opus-5-5)
AI involvement
AI-assisted
Independent or adversarial review
n/a. Found during human validation on a local sandbox of build 2072 and reproduced by the maintainer as the admin; the counts per account come from agent runtime testing on that sandbox, and the cause from source review of 4018816da.
Confirmations
- I searched open and recently closed issues and pull requests, and this is not already reported
- I reproduced this myself on a real deployment
- Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity