Library browse + search API with artwork (for the create-channel picker) #65

Closed
opened 2026-07-01 23:01:57 +02:00 by timothy · 6 comments
Owner

Part of #62 (Create Channel backend prerequisites).

Goal

An API to browse and search the media library with artwork, powering the left pane of the create-channel builder (grid of poster art, searchable, filterable by library).

Scope

  • List/search shows, movies, artists, collections across libraries with paging.
  • Return artwork references suitable for a poster grid.
  • Filter by library and media type; text search on title.
  • Fast enough for interactive typing (server-side search index already exists — reuse it).

Notes

  • May overlap with existing search infrastructure; prefer reuse over new query paths.
  • REST API layer (#2 conventions).

Scope additions from the ChicoryTV plan audit (2026-07-02)

The Channel Builder (#89) and Schedule editor (#86) prototypes consume more than artwork + title search. Add to this issue's scope:

  • Per-item duration and episode/item counts in the browse projection — the builder's lineup total and item sub-lines (min/sub) depend on them.
  • Collection metadata: type badge (Manual/Smart/Multi/Rerun), item count, total duration, artwork for collection results (list endpoints exist for collections/smart-collections but lack this projection).
  • Library list for filter chips — consume the media-sources read model (#103) rather than duplicating.
  • Typed picker resolution for the schedule editor's Content tab (#86): results must resolve to the correct id type per CollectionType (CollectionId / MultiCollectionId / SmartCollectionId / RerunCollectionId / MediaItemId for show/season/artist / PlaylistId). Shows/seasons/artists, playlists, multi-collections, and reruns currently have no browse/list endpoint at all.
Part of #62 (Create Channel backend prerequisites). ## Goal An API to browse and search the media library with artwork, powering the left pane of the create-channel builder (grid of poster art, searchable, filterable by library). ## Scope - List/search shows, movies, artists, collections across libraries with paging. - Return artwork references suitable for a poster grid. - Filter by library and media type; text search on title. - Fast enough for interactive typing (server-side search index already exists — reuse it). ## Notes - May overlap with existing search infrastructure; prefer reuse over new query paths. - REST API layer (#2 conventions). --- ## Scope additions from the ChicoryTV plan audit (2026-07-02) The Channel Builder (#89) and Schedule editor (#86) prototypes consume more than artwork + title search. Add to this issue's scope: - **Per-item duration and episode/item counts** in the browse projection — the builder's lineup total and item sub-lines (`min`/`sub`) depend on them. - **Collection metadata**: type badge (Manual/Smart/Multi/Rerun), item count, total duration, artwork for collection results (list endpoints exist for collections/smart-collections but lack this projection). - **Library list for filter chips** — consume the media-sources read model (#103) rather than duplicating. - **Typed picker resolution for the schedule editor's Content tab (#86)**: results must resolve to the correct id type per `CollectionType` (`CollectionId` / `MultiCollectionId` / `SmartCollectionId` / `RerunCollectionId` / `MediaItemId` for show/season/artist / `PlaylistId`). Shows/seasons/artists, playlists, multi-collections, and reruns currently have **no** browse/list endpoint at all.
timothy added a new dependency 2026-07-02 01:08:42 +02:00
Author
Owner

Findings / approach before coding

I inspected the existing REST foundation and search infrastructure in the issue #65 worktree.

Search-index reuse decision

  • Reuse ISearchIndex.Search(...) / LuceneSearchIndex for media-item candidate selection, paging, total count, type filtering, library filtering, and title search. Existing Blazor list/search pages already use this path (QuerySearchIndexMovies/Shows/Seasons/Artists/...).
  • Lucene currently returns only (type, id), so the browse handler will use Lucene for the interactive search/page candidate set, then do bounded EF projections for only the returned ids to add artwork/count/duration metadata. This avoids a new unbounded EF search path and avoids the #102-style wide include load.
  • Collections are not indexed by Lucene today. I’ll include collection results with narrow EF projections over Collection, SmartCollection, MultiCollection, RerunCollection, and Playlist tables, paged with the combined result set. If this becomes too large, I’ll keep media browse/search first and call out the split rather than silently dropping collection scope.

Projection shape

  • LibraryBrowseItemResponseModel fields planned: id, mediaType, title, libraryId, libraryName, artwork, duration, itemCount, collectionKind, and picker ids: collectionId, multiCollectionId, smartCollectionId, rerunCollectionId, mediaItemId, playlistId.
  • Artwork will reuse existing mapper URL conventions (/artwork/posters/..., Jellyfin/Emby relative proxy mapping, Plex-relative artwork routes where already used). I will not add a new artwork URL scheme.
  • For typed picker resolution: manual collection => CollectionId; smart => SmartCollectionId; multi => MultiCollectionId; rerun => RerunCollectionId; playlist => PlaylistId; movie/show/season/artist => MediaItemId with the corresponding CollectionType/media type.
  • Counts/durations will be best-effort aggregates from existing media versions/files and collection membership, projected with grouped queries rather than eager-loading full graphs.

Endpoints / DTOs

  • GET /api/library/browse (Name = "BrowseLibrary"): query params query, libraryId, mediaType, pageNum, pageSize; returns PagedLibraryBrowseItemsResponseModel.
  • Library filter chips will continue to come from the existing #103 read model: GET /api/media-sources (GetMediaSources). I’ll consume that model conceptually rather than duplicating a library list endpoint.

Tests / verification plan

  • Add controller tests for route/name, paging clamp, query mapping, and response projection.
  • Add handler tests around Lucene query construction/reuse, library/media-type filtering, artwork/duration/count projection, and typed picker ids.
  • Add OpenAPI/typegen regen after a successful app build, then run the requested build/test sequence.
## Findings / approach before coding I inspected the existing REST foundation and search infrastructure in the issue #65 worktree. **Search-index reuse decision** - Reuse `ISearchIndex.Search(...)` / `LuceneSearchIndex` for media-item candidate selection, paging, total count, type filtering, library filtering, and title search. Existing Blazor list/search pages already use this path (`QuerySearchIndexMovies/Shows/Seasons/Artists/...`). - Lucene currently returns only `(type, id)`, so the browse handler will use Lucene for the interactive search/page candidate set, then do bounded EF projections for only the returned ids to add artwork/count/duration metadata. This avoids a new unbounded EF search path and avoids the #102-style wide include load. - Collections are not indexed by Lucene today. I’ll include collection results with narrow EF projections over `Collection`, `SmartCollection`, `MultiCollection`, `RerunCollection`, and `Playlist` tables, paged with the combined result set. If this becomes too large, I’ll keep media browse/search first and call out the split rather than silently dropping collection scope. **Projection shape** - `LibraryBrowseItemResponseModel` fields planned: `id`, `mediaType`, `title`, `libraryId`, `libraryName`, `artwork`, `duration`, `itemCount`, `collectionKind`, and picker ids: `collectionId`, `multiCollectionId`, `smartCollectionId`, `rerunCollectionId`, `mediaItemId`, `playlistId`. - Artwork will reuse existing mapper URL conventions (`/artwork/posters/...`, Jellyfin/Emby relative proxy mapping, Plex-relative artwork routes where already used). I will not add a new artwork URL scheme. - For typed picker resolution: manual collection => `CollectionId`; smart => `SmartCollectionId`; multi => `MultiCollectionId`; rerun => `RerunCollectionId`; playlist => `PlaylistId`; movie/show/season/artist => `MediaItemId` with the corresponding `CollectionType`/media type. - Counts/durations will be best-effort aggregates from existing media versions/files and collection membership, projected with grouped queries rather than eager-loading full graphs. **Endpoints / DTOs** - `GET /api/library/browse` (`Name = "BrowseLibrary"`): query params `query`, `libraryId`, `mediaType`, `pageNum`, `pageSize`; returns `PagedLibraryBrowseItemsResponseModel`. - Library filter chips will continue to come from the existing #103 read model: `GET /api/media-sources` (`GetMediaSources`). I’ll consume that model conceptually rather than duplicating a library list endpoint. **Tests / verification plan** - Add controller tests for route/name, paging clamp, query mapping, and response projection. - Add handler tests around Lucene query construction/reuse, library/media-type filtering, artwork/duration/count projection, and typed picker ids. - Add OpenAPI/typegen regen after a successful app build, then run the requested build/test sequence.
Author
Owner

Done

What was done: Read-only inspection of existing Lucene/search infrastructure and Blazor/UI usage for issue #65, focused on ISearchIndex/LuceneSearchIndex, result shapes, indexed fields, current query handlers, and whether title search can support movies, shows, artists, and collections.

Root cause: n/a

Files changed: none

Verification: Read-only code inspection in /Users/timothy/ersatztv/.worktrees/issue-65-library-browse; no build/tests run because no code was changed.

Deferred: Implementation remains pending. Key finding: Lucene is suitable for media title search and paging for movies/shows/artists, but collections are not first-class Lucene documents today and existing collection autocomplete uses EF LIKE.

Follow-up issues: none

Docs updated: n/a

## Done **What was done**: Read-only inspection of existing Lucene/search infrastructure and Blazor/UI usage for issue #65, focused on `ISearchIndex`/`LuceneSearchIndex`, result shapes, indexed fields, current query handlers, and whether title search can support movies, shows, artists, and collections. **Root cause**: n/a **Files changed**: none **Verification**: Read-only code inspection in `/Users/timothy/ersatztv/.worktrees/issue-65-library-browse`; no build/tests run because no code was changed. **Deferred**: Implementation remains pending. Key finding: Lucene is suitable for media title search and paging for movies/shows/artists, but collections are not first-class Lucene documents today and existing collection autocomplete uses EF `LIKE`. **Follow-up issues**: none **Docs updated**: n/a
Author
Owner

Progress

Implemented the first backend slice in the issue worktree:

  • Added GET /api/library/browse (BrowseLibrary) with clamped paging.
  • Added LibraryBrowseMediaType, LibraryBrowseItemResponseModel, and PagedLibraryBrowseItemsResponseModel under ErsatzTV.Core/Api/LibraryBrowse with #nullable enable.
  • Added GetLibraryBrowseItems + handler.
  • Media browse/search reuses ISearchIndex.Search(...) for movie/show/season/artist candidate ids, type filters, library filters, title search, total count, and paging; EF only hydrates returned ids for title/artwork/duration/count fields.
  • Collection-like results are projected from narrow EF queries for manual, smart, multi, rerun, and playlist targets with schedule-picker id slots (CollectionId, SmartCollectionId, MultiCollectionId, RerunCollectionId, PlaylistId, MediaItemId).

Current test evidence:

  • TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj --filter "FullyQualifiedName~LibraryBrowseControllerTests|FullyQualifiedName~GetLibraryBrowseItemsHandlerTests" -v minimal => 6 passed.

Known scope caveat while continuing: manual collections and playlists currently expose cheap item counts; smart/multi/rerun aggregate duration/artwork is still limited because those are not first-class search-index documents and exact expansion can become expensive. I’m continuing verification and will either tighten this further or explicitly list it as deferred if it should split from core browse/search.

## Progress Implemented the first backend slice in the issue worktree: - Added `GET /api/library/browse` (`BrowseLibrary`) with clamped paging. - Added `LibraryBrowseMediaType`, `LibraryBrowseItemResponseModel`, and `PagedLibraryBrowseItemsResponseModel` under `ErsatzTV.Core/Api/LibraryBrowse` with `#nullable enable`. - Added `GetLibraryBrowseItems` + handler. - Media browse/search reuses `ISearchIndex.Search(...)` for movie/show/season/artist candidate ids, type filters, library filters, title search, total count, and paging; EF only hydrates returned ids for title/artwork/duration/count fields. - Collection-like results are projected from narrow EF queries for manual, smart, multi, rerun, and playlist targets with schedule-picker id slots (`CollectionId`, `SmartCollectionId`, `MultiCollectionId`, `RerunCollectionId`, `PlaylistId`, `MediaItemId`). Current test evidence: - `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj --filter "FullyQualifiedName~LibraryBrowseControllerTests|FullyQualifiedName~GetLibraryBrowseItemsHandlerTests" -v minimal` => 6 passed. Known scope caveat while continuing: manual collections and playlists currently expose cheap item counts; smart/multi/rerun aggregate duration/artwork is still limited because those are not first-class search-index documents and exact expansion can become expensive. I’m continuing verification and will either tighten this further or explicitly list it as deferred if it should split from core browse/search.
Author
Owner

Done

What was done: Opened PR #130 from feat/65-library-browse implementing the backend library browse/search API slice. Added GET /api/library/browse (BrowseLibrary) with clamped paging, title query, library filter, media-type filter, poster-grid artwork references, duration/count fields, and typed picker id slots for media, manual/smart/multi/rerun collections, and playlists. Media candidate search reuses ISearchIndex.Search(...) / Lucene for movie/show/season/artist candidate ids, total count, type filtering, library filtering, and interactive title search; EF only hydrates the bounded page ids. Collection-like targets are projected with narrow EF queries because collections are not first-class Lucene documents today. OpenAPI and generated TS types were regenerated.

Root cause: n/a

Files changed: ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItems.cs; ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItemsHandler.cs; ErsatzTV.Core/Api/LibraryBrowse/LibraryBrowseItemResponseModel.cs; ErsatzTV.Core/Api/LibraryBrowse/LibraryBrowseMediaType.cs; ErsatzTV.Core/Api/LibraryBrowse/PagedLibraryBrowseItemsResponseModel.cs; ErsatzTV/Controllers/Api/LibraryBrowseController.cs; ErsatzTV.Tests/Application/LibraryBrowse/GetLibraryBrowseItemsHandlerTests.cs; ErsatzTV.Tests/Controllers/LibraryBrowseControllerTests.cs; ErsatzTV/wwwroot/openapi/v1.json; web/src/api/generated/v1.d.ts.

Verification: TZ=UTC dotnet build ErsatzTV/ErsatzTV.csproj passed; ./scripts/update-openapi.sh was run, with the OpenAPI target rerun successfully after a local hang; TZ=UTC dotnet build ErsatzTV.sln passed; TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal passed 374 tests; TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj -v minimal passed 493 tests with 1 skipped; cd web && npm ci passed; cd web && npm run generate:api passed; cd web && npm run typecheck passed. PR CI run 251 for head 127a1307379f5dd9a07c7f4fb3874ab402799da3 completed successfully: Build & test passed, EF migration integrity passed, PR image job skipped.

Deferred: Exact aggregate total duration and representative artwork for smart/multi/rerun collections remain limited/deferred. Those targets are not first-class Lucene docs, and exact expansion risks becoming the expensive graph walk this issue explicitly wanted to avoid. Manual collection and playlist cheap counts are included; media duration/count projection is included. Library filter chips continue to come from the existing GET /api/media-sources read model rather than a duplicated endpoint.

Follow-up issues: none created; recommend splitting exact aggregate collection duration/artwork into a follow-up if Fable/user wants that before #65 closes.

Docs updated: OpenAPI v1.json and generated web API typings updated; no prose docs/skills changes.

## Done **What was done**: Opened PR #130 from `feat/65-library-browse` implementing the backend library browse/search API slice. Added `GET /api/library/browse` (`BrowseLibrary`) with clamped paging, title query, library filter, media-type filter, poster-grid artwork references, duration/count fields, and typed picker id slots for media, manual/smart/multi/rerun collections, and playlists. Media candidate search reuses `ISearchIndex.Search(...)` / Lucene for movie/show/season/artist candidate ids, total count, type filtering, library filtering, and interactive title search; EF only hydrates the bounded page ids. Collection-like targets are projected with narrow EF queries because collections are not first-class Lucene documents today. OpenAPI and generated TS types were regenerated. **Root cause**: n/a **Files changed**: `ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItems.cs`; `ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItemsHandler.cs`; `ErsatzTV.Core/Api/LibraryBrowse/LibraryBrowseItemResponseModel.cs`; `ErsatzTV.Core/Api/LibraryBrowse/LibraryBrowseMediaType.cs`; `ErsatzTV.Core/Api/LibraryBrowse/PagedLibraryBrowseItemsResponseModel.cs`; `ErsatzTV/Controllers/Api/LibraryBrowseController.cs`; `ErsatzTV.Tests/Application/LibraryBrowse/GetLibraryBrowseItemsHandlerTests.cs`; `ErsatzTV.Tests/Controllers/LibraryBrowseControllerTests.cs`; `ErsatzTV/wwwroot/openapi/v1.json`; `web/src/api/generated/v1.d.ts`. **Verification**: `TZ=UTC dotnet build ErsatzTV/ErsatzTV.csproj` passed; `./scripts/update-openapi.sh` was run, with the OpenAPI target rerun successfully after a local hang; `TZ=UTC dotnet build ErsatzTV.sln` passed; `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal` passed 374 tests; `TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj -v minimal` passed 493 tests with 1 skipped; `cd web && npm ci` passed; `cd web && npm run generate:api` passed; `cd web && npm run typecheck` passed. PR CI run 251 for head `127a1307379f5dd9a07c7f4fb3874ab402799da3` completed successfully: Build & test passed, EF migration integrity passed, PR image job skipped. **Deferred**: Exact aggregate total duration and representative artwork for smart/multi/rerun collections remain limited/deferred. Those targets are not first-class Lucene docs, and exact expansion risks becoming the expensive graph walk this issue explicitly wanted to avoid. Manual collection and playlist cheap counts are included; media duration/count projection is included. Library filter chips continue to come from the existing `GET /api/media-sources` read model rather than a duplicated endpoint. **Follow-up issues**: none created; recommend splitting exact aggregate collection duration/artwork into a follow-up if Fable/user wants that before #65 closes. **Docs updated**: OpenAPI `v1.json` and generated web API typings updated; no prose docs/skills changes.
Author
Owner

Done

What was done: Applied Fable review fixes on PR #130 and pushed 630119f382385040d77cd68b63b1ceb6fb88464b to feat/65-library-browse. Manual Collection browse rows now include bounded page-level total duration and representative poster artwork from collection member media. Added regression coverage for page transitions across media/manual/smart results, manual collection metadata, season hydration, artist hydration, and libraryId collection filtering. Also fixed the review nits: stale-index paging comment, deterministic metadata row selection, OpenAPI tag Libraries, escaped EF LIKE wildcards, deterministic max duration, and rerun schedule-addressing comment.

Root cause: Review follow-up; the original slice intentionally deferred smart/multi/rerun aggregates but also left manual collection artwork/duration empty even though manual collection members are directly reachable with bounded page queries.

Files changed: ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItemsHandler.cs; ErsatzTV.Tests/Application/LibraryBrowse/GetLibraryBrowseItemsHandlerTests.cs; ErsatzTV/Controllers/Api/LibraryBrowseController.cs; ErsatzTV/wwwroot/openapi/v1.json.

Verification: Focused red/green showed Handle_Should_Hydrate_Manual_Collection_Artwork_And_Total_Duration failing on the previous code, then focused FullyQualifiedName~LibraryBrowse passed 11 tests. TZ=UTC dotnet build ErsatzTV/ErsatzTV.csproj passed. ./scripts/update-openapi.sh was run after the successful build but locally returned Build FAILED after a silent 24m31s with 0 warnings/0 errors; the equivalent OpenAPI target TZ=UTC dotnet build ErsatzTV.csproj -t:GenerateOpenApiDocuments -v normal from ErsatzTV/ passed and regenerated v1.json. cd web && npm ci passed. cd web && npm run generate:api passed. cd web && npm run typecheck passed. TZ=UTC dotnet build ErsatzTV.sln passed. TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal passed 379 tests. TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj -v minimal passed 493 tests with 1 skipped. PR CI run 255 for head 630119f382385040d77cd68b63b1ceb6fb88464b completed successfully: Build & test passed, EF migration integrity passed, PR image job skipped.

Deferred: Exact aggregate duration/artwork for smart/multi/rerun collections remains deferred because exact expansion is the expensive graph walk already called out for this slice. Playlists remain count-only as accepted.

Follow-up issues: none created.

Docs updated: OpenAPI v1.json updated for the Libraries tag; generated TS types were regenerated and unchanged.

## Done **What was done**: Applied Fable review fixes on PR #130 and pushed `630119f382385040d77cd68b63b1ceb6fb88464b` to `feat/65-library-browse`. Manual `Collection` browse rows now include bounded page-level total duration and representative poster artwork from collection member media. Added regression coverage for page transitions across media/manual/smart results, manual collection metadata, season hydration, artist hydration, and libraryId collection filtering. Also fixed the review nits: stale-index paging comment, deterministic metadata row selection, OpenAPI tag `Libraries`, escaped EF `LIKE` wildcards, deterministic max duration, and rerun schedule-addressing comment. **Root cause**: Review follow-up; the original slice intentionally deferred smart/multi/rerun aggregates but also left manual collection artwork/duration empty even though manual collection members are directly reachable with bounded page queries. **Files changed**: `ErsatzTV.Application/LibraryBrowse/Queries/GetLibraryBrowseItemsHandler.cs`; `ErsatzTV.Tests/Application/LibraryBrowse/GetLibraryBrowseItemsHandlerTests.cs`; `ErsatzTV/Controllers/Api/LibraryBrowseController.cs`; `ErsatzTV/wwwroot/openapi/v1.json`. **Verification**: Focused red/green showed `Handle_Should_Hydrate_Manual_Collection_Artwork_And_Total_Duration` failing on the previous code, then focused `FullyQualifiedName~LibraryBrowse` passed 11 tests. `TZ=UTC dotnet build ErsatzTV/ErsatzTV.csproj` passed. `./scripts/update-openapi.sh` was run after the successful build but locally returned `Build FAILED` after a silent 24m31s with 0 warnings/0 errors; the equivalent OpenAPI target `TZ=UTC dotnet build ErsatzTV.csproj -t:GenerateOpenApiDocuments -v normal` from `ErsatzTV/` passed and regenerated `v1.json`. `cd web && npm ci` passed. `cd web && npm run generate:api` passed. `cd web && npm run typecheck` passed. `TZ=UTC dotnet build ErsatzTV.sln` passed. `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal` passed 379 tests. `TZ=UTC dotnet test ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj -v minimal` passed 493 tests with 1 skipped. PR CI run 255 for head `630119f382385040d77cd68b63b1ceb6fb88464b` completed successfully: Build & test passed, EF migration integrity passed, PR image job skipped. **Deferred**: Exact aggregate duration/artwork for smart/multi/rerun collections remains deferred because exact expansion is the expensive graph walk already called out for this slice. Playlists remain count-only as accepted. **Follow-up issues**: none created. **Docs updated**: OpenAPI `v1.json` updated for the `Libraries` tag; generated TS types were regenerated and unchanged.
Author
Owner

Closing #65 — merged to main via PR #130 (merge commit c4007293).

What was done

  • GET /api/library/browse (BrowseLibrary): unified browse/search across movies, shows, seasons, artists (via the existing Lucene ISearchIndex — reuse decision documented on this issue) plus manual/smart/multi/rerun collections and playlists (narrow EF projections; they are not Lucene documents). Paging spans both sources with a hand-verified skip cascade; pageNum/pageSize clamped server-side.
  • Projection includes title, library id/name, poster/thumb artwork (existing jellyfin://-emby:// proxy conventions), per-item duration, episode/item counts, collection type badge (Manual/Smart/Multi/Rerun), and typed picker ids per CollectionType (CollectionId/MultiCollectionId/SmartCollectionId/RerunCollectionId/MediaItemId/PlaylistId) for the #86/#89 pickers.
  • Review round (Fable, 3-lens read-only + delta verification): manual-collection total duration + representative artwork implemented (bounded per-page queries); deterministic metadata winner on multi-metadata items; LIKE wildcard escaping; Libraries tag; deterministic max duration; stale-index paging comment; RerunRerun note. New tests for cross-source paging, season/artist hydration, manual-collection metadata, and libraryId filtering (ErsatzTV.Tests 374→379).

Root cause: n/a (feature).

Files: ErsatzTV.Application/LibraryBrowse/, ErsatzTV.Core/Api/LibraryBrowse/, ErsatzTV/Controllers/Api/LibraryBrowseController.cs, tests, regenerated v1.json + web v1.d.ts.

Deferred (follow-up when #89 needs it): exact aggregate total duration + representative artwork for smart/multi/rerun collections (not first-class Lucene docs; exact expansion = expensive graph walk — they return kind badge + item counts today). Minor: the two manual-collection metadata helpers each fetch CollectionItems (could share one fetch); very large manual collections make the duration sum inherently heavy.

Docs: browse endpoint recorded in the ChicoryTV issue-queue handoff (docs/handoffs/chicorytv-issue-queue.md); no operational doc impact.

Library filter chips remain sourced from GET /api/media-sources per the scope note.

**Closing #65 — merged to main via PR #130 (merge commit c4007293).** **What was done** - `GET /api/library/browse` (`BrowseLibrary`): unified browse/search across movies, shows, seasons, artists (via the existing Lucene `ISearchIndex` — reuse decision documented on this issue) plus manual/smart/multi/rerun collections and playlists (narrow EF projections; they are not Lucene documents). Paging spans both sources with a hand-verified skip cascade; pageNum/pageSize clamped server-side. - Projection includes title, library id/name, poster/thumb artwork (existing jellyfin://-emby:// proxy conventions), per-item duration, episode/item counts, collection type badge (Manual/Smart/Multi/Rerun), and typed picker ids per `CollectionType` (CollectionId/MultiCollectionId/SmartCollectionId/RerunCollectionId/MediaItemId/PlaylistId) for the #86/#89 pickers. - Review round (Fable, 3-lens read-only + delta verification): manual-collection total duration + representative artwork implemented (bounded per-page queries); deterministic metadata winner on multi-metadata items; LIKE wildcard escaping; `Libraries` tag; deterministic max duration; stale-index paging comment; RerunRerun note. New tests for cross-source paging, season/artist hydration, manual-collection metadata, and libraryId filtering (ErsatzTV.Tests 374→379). **Root cause**: n/a (feature). **Files**: ErsatzTV.Application/LibraryBrowse/*, ErsatzTV.Core/Api/LibraryBrowse/*, ErsatzTV/Controllers/Api/LibraryBrowseController.cs, tests, regenerated v1.json + web v1.d.ts. **Deferred** (follow-up when #89 needs it): exact aggregate total duration + representative artwork for smart/multi/rerun collections (not first-class Lucene docs; exact expansion = expensive graph walk — they return kind badge + item counts today). Minor: the two manual-collection metadata helpers each fetch CollectionItems (could share one fetch); very large manual collections make the duration sum inherently heavy. **Docs**: browse endpoint recorded in the ChicoryTV issue-queue handoff (docs/handoffs/chicorytv-issue-queue.md); no operational doc impact. Library filter chips remain sourced from `GET /api/media-sources` per the scope note.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: timothy/ersatztv#65