Skip to content

feat(jellycompat): BoxSet collections, genre-by-name, and airtight ABS media exclusion - #115

Merged
Quick104 merged 3 commits into
mainfrom
claude/determined-bose-1a16d1
Jun 9, 2026
Merged

Quick104 merged 3 commits into
mainfrom
claude/determined-bose-1a16d1

Conversation

@Quick104

@Quick104 Quick104 commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Jellyfin compat API was missing endpoints clients use for browsing, and leaked ABS-surface content:

  • Collections/BoxSets were not implemented — IncludeItemTypes=BoxSet fell through to a full library browse, and collection IDs were unaddressable.
  • Audiobook (and podcast) libraries were fully exposed through Views, browse, search, detail, and PlaybackInfo, even though those media are served by the audiobookshelf-compat API.
  • /Genres/{name} was unregistered.

What changed

BoxSets — LibraryCollection is now exposed as Jellyfin BoxSets: IncludeItemTypes=BoxSet listing (optionally scoped by ParentId library, with SearchTerm/NameStartsWith/SortName support), /Items/{id} detail, ParentId={boxset} children preserving curated position order (explicit SortBy delegates ordering/paging to catalog), Ids= re-hydration, and durable artwork (stable signed tags from the artwork key + a collections fallback in the images handler, so posters survive restarts and presign rotation). Listing filters/sorts/pages the lightweight rows before building DTOs, so a Limit=24 page over hundreds of collections doesn't presign every poster.

ABS media exclusion — implemented at the access-filter layer rather than per endpoint: catalog.AccessFilter gained ExcludedMediaTypes, enforced by applyAccessFilter and threaded through Search, GetByIDsWithAccess, EnsureAccessible, and BrowseFavorites. The compat router stamps audiobook + podcast exclusions onto every resolved filter in one place (withDefaults), so favorites, recommendations, images, and future data paths inherit the exclusion. Audiobook/podcast libraries are hidden from Views/VirtualFolders, and browse/genre listings clamp to video types.

Dispatch correctness — /Items requests whose IncludeItemTypes map to nothing exposable return empty instead of falling through to views/browse; CollectionFolder still returns library views; BoxSet listings don't hijack Filters=IsFavorite/IsResumable/IsPlayed queries (they return empty, matching prior behavior).

Genres — GET /Genres/{name} resolves canonical casing scoped to the caller's visible libraries; GenreIds=/ParentId filtering verified covered by existing paths.

Why this approach

A review pass on the first commit found the per-call-site exclusion pattern had already missed three paths (favorites, recommendations, item images) within the same PR — moving the exclusion into AccessFilter makes it structural instead of a convention every new endpoint must remember.

Testing

  • New unit tests: BoxSet listing/visibility/scoping, children position-order + pagination, detail + hidden-collection 404, Ids= re-hydration, user-state-filtered BoxSet queries, CollectionFolder views, unmapped-type empty results, type-scope clamps, hidden-library exclusion, access-filter wrapper, /Genres/{name}.
  • Full ./internal/... suite green; go vet + gofmt clean.
  • Deployed to the dev server (make dev-deploy) and verified on an Nvidia Shield Jellyfin client: audiobook library hidden, collections/genres browsable, streaming intact.

Risks / follow-ups

  • Mixed IncludeItemTypes=Movie,BoxSet does not interleave collections with movies (real Jellyfin merges both); needs cross-source pagination, documented at the dispatch site.
  • Non-numeric route IDs have a theoretical 1/256 first-byte collision with the new collection ID kind; all current IDs are numeric snowflakes, so this is latent.
  • ListAll(nil) for collections is heavier than needed for the compat listing (counts members per request); a slim list query or short-TTL cache is a possible follow-up if collection counts grow.

AI-use disclosure

Implemented by Claude Code (Fable 5) under human direction, including a multi-agent review pass whose findings were fixed in the second commit; human-validated on the dev server and Shield client.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Jellyfin-compatible collections/BoxSet support with metadata, stable IDs and collection artwork routes (presigned images)
    • New genre-by-name endpoint for compat layer
  • Behavior Changes

    • Compat media-type filtering now consistently hides audiobooks/podcasts across browse, search, favorites, item detail (404 for excluded types) and user favorites pagination
  • Tests

    • Added tests covering collections, genre browsing, compat media-type exclusions and related behaviors

Quick104 and others added 2 commits June 9, 2026 17:27
…-by-name

- Audiobook libraries (type 'audiobooks'/'audiobook') no longer appear in
  Views/VirtualFolders, and all browse/search/genre/detail paths are clamped
  to movie/series/episode so audiobook items cannot leak or stream through
  the Jellyfin compat surface (they are served by the ABS-compat API).
- Library collections are now exposed as Jellyfin BoxSets:
  IncludeItemTypes=BoxSet listing (optionally scoped via ParentId library),
  /Items/{id} BoxSet detail, ParentId children with curated position order
  preserved (explicit SortBy delegates to catalog ordering), poster/backdrop
  presigning, and visibility + library-access filtering.
- /Items with only unexposable IncludeItemTypes (e.g. Playlist) returns an
  empty result instead of falling through to views/browse.
- New GET /Genres/{name} endpoint resolving canonical genre casing.

Co-Authored-By: Claude Fable 5 <[email protected]>
…e cases from review

- Add catalog.AccessFilter.ExcludedMediaTypes, enforced by applyAccessFilter
  and threaded through Search/GetByIDsWithAccess/EnsureAccessible and
  BrowseFavorites. The compat layer stamps audiobook+podcast exclusions onto
  every resolved access filter (one wrap in withDefaults), closing the
  favorites, recommendations, and item-image leak paths that per-call-site
  guards missed.
- Treat podcast libraries like audiobook libraries: hidden from Views, items
  excluded everywhere (they're served by the ABS-compat API).
- HandleItems: BoxSet listing no longer hijacks user-state-filtered queries
  (IncludeItemTypes=BoxSet&Filters=IsFavorite returns empty again),
  IncludeItemTypes=CollectionFolder returns library views as before, and
  Ids=<boxsetId> re-hydrates the BoxSet DTO instead of falling through to
  the views response.
- BoxSet artwork is now durable: stable signed tags seeded from the artwork
  key (no churn on presign rotation) plus a collections fallback in the
  images handler, so posters survive restarts and cache expiry.
- BoxSet listing filters/sorts/pages the lightweight collection rows before
  building DTOs, so a Limit=24 page over 300 collections no longer presigns
  ~600 posters per request; collection children also page before hydrating
  user state.
- Dedupe: shared loadVisibleCollection guard, shared collection-page writer,
  single scoped-types implementation, emptyQueryResult helper.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 85e35fe1-be57-4ece-ab74-15ea70e1445f

📥 Commits

Reviewing files that changed from the base of the PR and between b1555f0 and 60eb786.

📒 Files selected for processing (5)
  • internal/jellycompat/audiobook_exclusion_test.go
  • internal/jellycompat/content_direct.go
  • internal/jellycompat/handlers_collections.go
  • internal/jellycompat/handlers_images.go
  • internal/jellycompat/userdata_direct.go

📝 Walkthrough

Walkthrough

This PR extends Jellyfin compatibility and catalog layers to hide audiobooks/podcasts from the Jellycompat surface and introduces full BoxSet (collection) support, including listing, detail retrieval, member hydration, artwork serving, and genre endpoints.

Changes

Media-Type Exclusion Infrastructure

Layer / File(s) Summary
Catalog access-filter media-type field
internal/catalog/access_filter.go
AccessFilter struct gains ExcludedMediaTypes []string; applyAccessFilter adds NOT (alias.type = ANY($N)) when exclusions are provided.
Catalog repositories applying media-type exclusions
internal/catalog/item_repo.go, internal/catalog/favorites_browse.go
GetByIDsWithAccess, Search, EnsureAccessible, and favorites browse plan now pass ExcludedMediaTypes into applyAccessFilter.
Compat content scoping and access-filter stamping
internal/jellycompat/content_direct.go
Adds compat-visible/excluded media-type helpers, hides audiobook/podcast library folder types, clamps incoming type/itemTypes to compat-exposed values, and stamps resolved catalog.AccessFilter with compat exclusions; guards ListUserLibraries, BrowseItems, SearchItems, GetItemDetail, and ListItemFilters.
User favorites filtering and small tests
internal/jellycompat/userdata_direct.go, internal/jellycompat/auth_test.go
ListFavorites over-fetches then filters out compat-excluded types before paging and presigning; small test whitespace adjustment.

Collection/BoxSet Support

Layer / File(s) Summary
Collection ID codec
internal/jellycompat/idcodec.go
Adds EncodedIDCollection constant and UUID namespace for deterministic collection ID encoding/decoding.
Query parsing for collections and BoxSet flags
internal/jellycompat/query.go
itemsQuery adds parentCollectionID, specificCollectionIDs, and flags (wantsBoxSets, wantsViews, sortExplicit); parsing decodes ParentId/Ids as collection IDs and inspects raw IncludeItemTypes/SortBy.
Collection handlers and BoxSet DTO construction
internal/jellycompat/handlers_collections.go
Implements collectionSource, visibility checks, BoxSet DTO generation, GET /Items listing, GET /Items/{id} detail, GET /Items?ParentId={id} member hydration, plus boxSetsByIDs, slicePage, and writeCollectionItemsPage.
Collection handler testing
internal/jellycompat/handlers_collections_test.go
In-memory fakes and tests for BoxSet listing (hidden-library filtering, parent scoping, search/sort), children ordering/pagination, detail visibility, Ids rehydration, and query parsing flags.
Items handler collection integration and genres endpoint
internal/jellycompat/handlers_items.go, internal/jellycompat/handlers_genres_test.go
ItemsHandler gains collection deps and presigning config, routes collection-specific queries, appends BoxSet DTOs for specific collection IDs, adds HandleGenreByName, and wraps resolved access filters with compat exclusions; genre test validates canonical genre resolution.
Images handler collection artwork support
internal/jellycompat/handlers_images.go
ImagesHandler gains optional collections source; decodes collection IDs in image routes; resolves and presigns collection artwork for tag-authenticated and session-authenticated requests.
Router wiring and compat access-filter resolver
internal/jellycompat/router.go
Wires collections and poster-presigner into handlers, adds /Genres/{name} route, and wraps global access-filter resolver with compatAccessFilterResolver.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Silo-Server/silo-server#72: touches internal/jellycompat/content_direct.go and related library visibility/access-filtering logic.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the three main features implemented: BoxSet collections support, genre-by-name endpoint, and ABS media type exclusion—all of which are well-represented in the substantial changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/determined-bose-1a16d1

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
internal/jellycompat/handlers_collections.go (1)

60-63: 💤 Low value

Potential silent error swallowing on collection lookup.

When GetByID returns a non-nil error (e.g., database connection failure), this returns (nil, nil) which callers interpret as "collection not found." Transient failures would be masked as 404s.

Consider distinguishing not-found from actual errors:

♻️ Suggested change
 func (h *ItemsHandler) loadVisibleCollection(ctx context.Context, session *Session, collectionID string) (*models.LibraryCollection, error) {
 	if h.collections == nil {
 		return nil, nil
 	}
 	collection, err := h.collections.GetByID(ctx, collectionID)
+	if err != nil {
+		return nil, err
+	}
-	if err != nil || collection == nil {
+	if collection == nil {
 		return nil, nil
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/jellycompat/handlers_collections.go` around lines 60 - 63, The
current GetByID handling swallows real errors by returning (nil, nil) whenever
err != nil or collection == nil; change the logic in the handler so that if
h.collections.GetByID(ctx, collectionID) returns a non-nil error you return that
error (e.g., return nil, err), and only return (nil, nil) when err == nil and
collection == nil (meaning truly not found); update the branch around
h.collections.GetByID to first check err and propagate it, then handle the
nil-collection not-found case.
internal/jellycompat/audiobook_exclusion_test.go (1)

12-31: ⚡ Quick win

Add regression cases for pre-populated exclusions and non-video explicit types.

These tests currently miss two boundary cases: base resolver already returning ExcludedMediaTypes, and explicit non-video types reducing to compatNoMatchType. Adding both will lock in the exclusion boundary.

Also applies to: 60-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/jellycompat/audiobook_exclusion_test.go` around lines 12 - 31, Add
two regression cases to TestCompatScopedTypes: (1) a case where the input is
already the exclusion sentinel (compatNoMatchType) and the expected output
remains compatNoMatchType to cover the "pre-populated ExcludedMediaTypes"
boundary, and (2) a case with only non-video explicit types (e.g.,
"audiobook,podcast") expecting compatNoMatchType so explicit non-video lists
collapse to the exclusion sentinel; update the cases slice in
TestCompatScopedTypes that exercises compatScopedTypes to include these two
entries (refer to compatScopedTypes and compatNoMatchType).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/jellycompat/content_direct.go`:
- Around line 80-84: withCompatAccessExclusions currently replaces
ExcludedMediaTypes only when empty, which fails to enforce
compatExcludedMediaTypes if the base filter already has entries; update
withCompatAccessExclusions to merge/union compatExcludedMediaTypes into
filter.ExcludedMediaTypes (referencing withCompatAccessExclusions,
catalog.AccessFilter.ExcludedMediaTypes, and compatExcludedMediaTypes),
appending any missing values and removing duplicates so existing exclusions are
preserved and "audiobook"/"podcast" are always enforced.
- Around line 108-124: compatScopedSearchTypes currently accepts any
non-excluded explicit type and can pass unsupported/non-video types downstream;
change it to clamp explicit types to the allowed video set: build a lookup from
compatVideoTypeList and, after normalizing each input
(strings.ToLower/TrimSpace), only keep types that exist in that lookup; if the
intersection is empty return []string{compatNoMatchType}, otherwise return the
intersected list — this keeps compatScopedSearchTypes (and callers like
compatScopedTypes) from forwarding unsupported types.

---

Nitpick comments:
In `@internal/jellycompat/audiobook_exclusion_test.go`:
- Around line 12-31: Add two regression cases to TestCompatScopedTypes: (1) a
case where the input is already the exclusion sentinel (compatNoMatchType) and
the expected output remains compatNoMatchType to cover the "pre-populated
ExcludedMediaTypes" boundary, and (2) a case with only non-video explicit types
(e.g., "audiobook,podcast") expecting compatNoMatchType so explicit non-video
lists collapse to the exclusion sentinel; update the cases slice in
TestCompatScopedTypes that exercises compatScopedTypes to include these two
entries (refer to compatScopedTypes and compatNoMatchType).

In `@internal/jellycompat/handlers_collections.go`:
- Around line 60-63: The current GetByID handling swallows real errors by
returning (nil, nil) whenever err != nil or collection == nil; change the logic
in the handler so that if h.collections.GetByID(ctx, collectionID) returns a
non-nil error you return that error (e.g., return nil, err), and only return
(nil, nil) when err == nil and collection == nil (meaning truly not found);
update the branch around h.collections.GetByID to first check err and propagate
it, then handle the nil-collection not-found case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c17b0e79-3e72-4d2b-84c9-15594380e8b7

📥 Commits

Reviewing files that changed from the base of the PR and between 7040fa4 and b1555f0.

📒 Files selected for processing (15)
  • internal/catalog/access_filter.go
  • internal/catalog/favorites_browse.go
  • internal/catalog/item_repo.go
  • internal/jellycompat/audiobook_exclusion_test.go
  • internal/jellycompat/auth_test.go
  • internal/jellycompat/content_direct.go
  • internal/jellycompat/handlers_collections.go
  • internal/jellycompat/handlers_collections_test.go
  • internal/jellycompat/handlers_genres_test.go
  • internal/jellycompat/handlers_images.go
  • internal/jellycompat/handlers_items.go
  • internal/jellycompat/idcodec.go
  • internal/jellycompat/query.go
  • internal/jellycompat/router.go
  • internal/jellycompat/userdata_direct.go

Comment thread internal/jellycompat/content_direct.go Resolved
Comment thread internal/jellycompat/content_direct.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1555f073c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +336 to +341
collection, err := h.collections.GetByID(r.Context(), collectionID)
if err != nil || collection == nil {
writeError(w, http.StatusNotFound, "NotFound", "Item not found")
return
}
imageURL := h.presignCollectionArtwork(r.Context(), collectionArtworkKey(collection, imageType))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check collection visibility before serving artwork

When an authenticated user requests /Items/{boxSetId}/Images/Primary without a valid image tag, this path loads the collection directly and serves its artwork without applying the same loadVisibleCollection/collectionVisible checks used by /Items/{id} and BoxSet listings. For collections in hidden libraries or libraries outside the user's access scope, knowing or retaining the encoded collection ID is enough to retrieve the poster/backdrop even though the collection detail correctly 404s; pass the session through and reuse the visibility check before presigning the artwork.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 60eb786 — handleCollectionImage now applies the same rules as the BoxSet item endpoints: visibility must be 'visible' and the collection must intersect the session's visible libraries (via the shared visibleLibraryIDSet helper), otherwise 404. The tag path is unchanged by design: tags are only signed for collections served by the visible listing.

Comment on lines +72 to +75
// Favorites are shared with the ABS surface; its media types are
// never exposed here (they would 404 on detail/PlaybackInfo).
if isCompatExcludedMediaType(mi.Type) {
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter favorites before applying pagination

When a user has audiobook/podcast favorites mixed with video favorites, this filter runs after store.ListFavorites has already applied the requested raw limit/offset window, while handleFavoriteItems later treats the filtered slice as the visible result set. In that case later favorites pages can under-fill or go empty even though enough video favorites exist after the skipped ABS entries; the exclusion needs to happen in the favorites query/window, or the caller needs to keep fetching until it has enough visible items.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 60eb786 — ListFavorites now over-fetches the raw favorite rows (2x window, min 200, capped 10000), filters ABS-surface types, rebuilds favorite order, and only then applies the offset/limit window — so pages no longer shrink or shift. Artwork is presigned only for the returned page.

Comment on lines +60 to +62
collection, err := h.collections.GetByID(ctx, collectionID)
if err != nil || collection == nil {
return nil, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate collection lookup errors

If the collection repository returns a database or other upstream error here, loadVisibleCollection treats it the same as a missing collection and the handlers return 404/empty results. During a transient DB failure or query error this masks the outage as “not found,” causing clients to drop or cache missing BoxSets instead of retrying; only the not-found case should be swallowed, and other errors should be returned to writeCompatUpstreamError.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 60eb786 — loadVisibleCollection (and the images-handler lookup) now map only catalog.ErrLibraryCollectionNotFound to not-found; any other repo error propagates to writeCompatUpstreamError so transient DB failures surface as 5xx instead of 404/empty.

- withCompatAccessExclusions merges compat exclusions with any the base
  resolver already supplies instead of conditionally skipping them.
- Explicit type filters clamp to a closed allowlist (movie/series/episode/
  season) rather than passing unknown types through to catalog queries.
- Collection artwork on the session path applies the same visibility rules
  as the BoxSet item endpoints (hidden or inaccessible-library collections
  404 instead of serving posters).
- loadVisibleCollection propagates infrastructure errors instead of masking
  transient DB failures as 404/empty; only ErrLibraryCollectionNotFound maps
  to not-found.
- ListFavorites filters ABS-surface favorites before applying the
  limit/offset window (over-fetching the raw rows) so pages don't shrink or
  shift, and presigns artwork only for the returned page.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Quick104
Quick104 merged commit 4c38d8c into main Jun 9, 2026
14 of 15 checks passed
@Quick104
Quick104 deleted the claude/determined-bose-1a16d1 branch June 9, 2026 23:16
Quick104 added a commit that referenced this pull request Jun 11, 2026
…S media exclusion (#115)

* feat(jellycompat): exclude audiobook libraries, add BoxSets and genre-by-name

- Audiobook libraries (type 'audiobooks'/'audiobook') no longer appear in
  Views/VirtualFolders, and all browse/search/genre/detail paths are clamped
  to movie/series/episode so audiobook items cannot leak or stream through
  the Jellyfin compat surface (they are served by the ABS-compat API).
- Library collections are now exposed as Jellyfin BoxSets:
  IncludeItemTypes=BoxSet listing (optionally scoped via ParentId library),
  /Items/{id} BoxSet detail, ParentId children with curated position order
  preserved (explicit SortBy delegates to catalog ordering), poster/backdrop
  presigning, and visibility + library-access filtering.
- /Items with only unexposable IncludeItemTypes (e.g. Playlist) returns an
  empty result instead of falling through to views/browse.
- New GET /Genres/{name} endpoint resolving canonical genre casing.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(jellycompat): centralize ABS media-type exclusion, fix BoxSet edge cases from review

- Add catalog.AccessFilter.ExcludedMediaTypes, enforced by applyAccessFilter
  and threaded through Search/GetByIDsWithAccess/EnsureAccessible and
  BrowseFavorites. The compat layer stamps audiobook+podcast exclusions onto
  every resolved access filter (one wrap in withDefaults), closing the
  favorites, recommendations, and item-image leak paths that per-call-site
  guards missed.
- Treat podcast libraries like audiobook libraries: hidden from Views, items
  excluded everywhere (they're served by the ABS-compat API).
- HandleItems: BoxSet listing no longer hijacks user-state-filtered queries
  (IncludeItemTypes=BoxSet&Filters=IsFavorite returns empty again),
  IncludeItemTypes=CollectionFolder returns library views as before, and
  Ids=<boxsetId> re-hydrates the BoxSet DTO instead of falling through to
  the views response.
- BoxSet artwork is now durable: stable signed tags seeded from the artwork
  key (no churn on presign rotation) plus a collections fallback in the
  images handler, so posters survive restarts and cache expiry.
- BoxSet listing filters/sorts/pages the lightweight collection rows before
  building DTOs, so a Limit=24 page over 300 collections no longer presigns
  ~600 posters per request; collection children also page before hydrating
  user state.
- Dedupe: shared loadVisibleCollection guard, shared collection-page writer,
  single scoped-types implementation, emptyQueryResult helper.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(jellycompat): address PR review comments

- withCompatAccessExclusions merges compat exclusions with any the base
  resolver already supplies instead of conditionally skipping them.
- Explicit type filters clamp to a closed allowlist (movie/series/episode/
  season) rather than passing unknown types through to catalog queries.
- Collection artwork on the session path applies the same visibility rules
  as the BoxSet item endpoints (hidden or inaccessible-library collections
  404 instead of serving posters).
- loadVisibleCollection propagates infrastructure errors instead of masking
  transient DB failures as 404/empty; only ErrLibraryCollectionNotFound maps
  to not-found.
- ListFavorites filters ABS-surface favorites before applying the
  limit/offset window (over-fetching the raw rows) so pages don't shrink or
  shift, and presigns artwork only for the returned page.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Quick104 added a commit that referenced this pull request Jun 17, 2026
…S media exclusion (#115)

* feat(jellycompat): exclude audiobook libraries, add BoxSets and genre-by-name

- Audiobook libraries (type 'audiobooks'/'audiobook') no longer appear in
  Views/VirtualFolders, and all browse/search/genre/detail paths are clamped
  to movie/series/episode so audiobook items cannot leak or stream through
  the Jellyfin compat surface (they are served by the ABS-compat API).
- Library collections are now exposed as Jellyfin BoxSets:
  IncludeItemTypes=BoxSet listing (optionally scoped via ParentId library),
  /Items/{id} BoxSet detail, ParentId children with curated position order
  preserved (explicit SortBy delegates to catalog ordering), poster/backdrop
  presigning, and visibility + library-access filtering.
- /Items with only unexposable IncludeItemTypes (e.g. Playlist) returns an
  empty result instead of falling through to views/browse.
- New GET /Genres/{name} endpoint resolving canonical genre casing.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(jellycompat): centralize ABS media-type exclusion, fix BoxSet edge cases from review

- Add catalog.AccessFilter.ExcludedMediaTypes, enforced by applyAccessFilter
  and threaded through Search/GetByIDsWithAccess/EnsureAccessible and
  BrowseFavorites. The compat layer stamps audiobook+podcast exclusions onto
  every resolved access filter (one wrap in withDefaults), closing the
  favorites, recommendations, and item-image leak paths that per-call-site
  guards missed.
- Treat podcast libraries like audiobook libraries: hidden from Views, items
  excluded everywhere (they're served by the ABS-compat API).
- HandleItems: BoxSet listing no longer hijacks user-state-filtered queries
  (IncludeItemTypes=BoxSet&Filters=IsFavorite returns empty again),
  IncludeItemTypes=CollectionFolder returns library views as before, and
  Ids=<boxsetId> re-hydrates the BoxSet DTO instead of falling through to
  the views response.
- BoxSet artwork is now durable: stable signed tags seeded from the artwork
  key (no churn on presign rotation) plus a collections fallback in the
  images handler, so posters survive restarts and cache expiry.
- BoxSet listing filters/sorts/pages the lightweight collection rows before
  building DTOs, so a Limit=24 page over 300 collections no longer presigns
  ~600 posters per request; collection children also page before hydrating
  user state.
- Dedupe: shared loadVisibleCollection guard, shared collection-page writer,
  single scoped-types implementation, emptyQueryResult helper.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(jellycompat): address PR review comments

- withCompatAccessExclusions merges compat exclusions with any the base
  resolver already supplies instead of conditionally skipping them.
- Explicit type filters clamp to a closed allowlist (movie/series/episode/
  season) rather than passing unknown types through to catalog queries.
- Collection artwork on the session path applies the same visibility rules
  as the BoxSet item endpoints (hidden or inaccessible-library collections
  404 instead of serving posters).
- loadVisibleCollection propagates infrastructure errors instead of masking
  transient DB failures as 404/empty; only ErrLibraryCollectionNotFound maps
  to not-found.
- ListFavorites filters ABS-surface favorites before applying the
  limit/offset window (over-fetching the raw rows) so pages don't shrink or
  shift, and presigns artwork only for the returned page.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant