Skip to content

[bug] Server collections show full item counts, and appear at all, to profiles that can see none of their titles #2828

Closed

Description

@Quick104

What happened

Server (admin) collections show every profile the same item count, and a profile sees a collection even when it can open none of its titles. Only the member list is filtered per profile.

A profile with a content-rating limit sees, for example, a collection card that says 9 titles and opens empty. That shows a child profile the names and sizes of collections it isn't meant to see. A profile limited to one library sees counts that include titles from libraries hidden from it when a collection spans both.

Personal collections already count only the titles the viewer can see.

Steps to reproduce

Not reproduced on a live deployment; the sandbox host had no capacity during this run. The focused database test below fails on main at 64e7fec.

  1. Create two movie libraries, A and B.
  2. Add two titles rated 17+ and one title rated 7+ to library A, and one title rated 7+ to library B.
  3. Create visible server collections scoped to library A: one manual collection holding only the two 17+ titles, and one smart collection matching every movie in A. Create a manual collection scoped to A and B holding one 17+ title from A, the 7+ title from A, and the title from B.
  4. As a profile limited to library A with a PG-13 rating limit, list server collections (GET /api/v2/collections/server) and library A's Collections tab (GET /api/v2/library/{id}/collections).

Result: the 17+-only collection is listed with 2 titles, the mixed collection with 3, and the smart collection with 3. Each one opens with 0, 1 and 1 titles.

Expected behavior

Each collection's count is the number of titles that profile can open. A collection whose titles are all hidden from the profile by its limits is not listed. Unrestricted profiles and admins keep the current counts. A collection with no titles for anyone stays listed with 0, as #193 S4 records. The admin collection editor is unchanged.

Silo version / commit

main at 64e7fec

Deployment

Local dev build

Area

Libraries, scanning, and metadata

Clients affected

  • Web UI
  • Android
  • iOS/tvOS/macOS
  • Jellyfin-compat client (Infuse, Findroid, ...)

Relevant logs

No logs available. The listing succeeds; the counts are wrong.

Technical notes

  • The count comes from internal/catalog/library_collection_repo.go (libraryCollectionColumns): COUNT(DISTINCT lci.media_item_id) for stored collections, or item_count_cached for smart ones. The smart-count refresher computes that cache without an access filter.
  • ListServerCollections (internal/api/handlers/server_collections.go) and LibraryCollectionsTab (internal/api/handlers/library_views_service.go) return that count unchanged, on both /api/v1 and /api/v2. jellycompat BoxSets (internal/jellycompat/handlers_collections.go) report it as ChildCount and RecursiveItemCount.
  • Personal collections already use a per-viewer count (internal/api/handlers/collections_item_counts.go).

AI harness

Claude Code

AI tool(s)

T3 Code orchestration

AI model(s)

claude-opus-5-5

AI involvement

AI-assisted

Independent or adversarial review

The fix plan is under cross-provider review (Codex, gpt-6.1-sol).

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

Source: maintainer source review

Activity

  1. added
    bug
    on Oct 21, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. Quick104 commented on Oct 21, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code (claude-opus-5-5) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

  4. added
    impact: security
    priority: P1
    on Oct 21, 2026
  5. added a commit that references this issue on Oct 21, 2026
    6bfc5ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimpact: securitypriority: P1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions