diff --git a/docs/blazor-route-parity.md b/docs/blazor-route-parity.md index 9e1b0368e..1c8b5e2b5 100644 --- a/docs/blazor-route-parity.md +++ b/docs/blazor-route-parity.md @@ -73,6 +73,8 @@ been added to the redirect map yet. | `/playouts/classic/{Id}`, `/playouts/block/{Id}`, `/playouts/scripted/{Id}`, `/playouts/sequential/{Id}` | `ClassicPlayoutEditor.razor`, `BlockPlayoutEditor.razor`, `ScriptedPlayoutEditor.razor`, `SequentialPlayoutEditor.razor` | `/app/playouts` | merged; #144 S5/S6 | | `/playouts/{Id:int}/alternate-schedules` | `PlayoutAlternateSchedulesEditor.razor` | `/app/playouts/{id}/alternate-schedules` | allowSubPaths (`PlayoutsRouteScreen`); #144 S6/#162 | | `/playouts/{Id:int}/templates` | `PlayoutTemplatesEditor.razor` | `/app/playouts/{id}/templates` | allowSubPaths (`PlayoutsRouteScreen`); #144 S6/#162 | +| `/media/multi-collections`(`/add`, `/{Id}/edit`) | `MultiCollections.razor`, `MultiCollectionEditor.razor` | `/app/multi-collections` | **SPA DONE** (`MultiCollectionsScreen`; in-screen list↔editor via local state, no sub-paths); #151 | +| `/media/rerun-collections`(`/add`, `/{Id}/edit`) | `RerunCollections.razor`, `RerunCollectionEditor.razor` | `/app/rerun-collections` | **SPA DONE** (`RerunCollectionsScreen`; in-screen list↔editor via local state, no sub-paths); #152 | | `/schedules/{Id:int}`, `/schedules/add`, `/schedules/{Id:int}/items` | `ScheduleEditor.razor`, `ScheduleItemsEditor.razor` | `/app/schedules` | merged into schedules screen | | `/media/filler/presets`(`/add`, `/{Id}/edit`) | `FillerPresets.razor`, `FillerPresetEditor.razor` | `/app/filler-presets` | allowSubPaths | | `/media/collections`(`/add`, `/{Id}/edit`, `/{Id}`) | `ManualCollections.razor`, `CollectionEditor.razor`, `CollectionItems.razor` + `SmartCollections.razor`/`SmartCollectionEditor.razor` | `/app/collections` | allowSubPaths | @@ -100,12 +102,16 @@ been added to the redirect map yet. ## Section 3 — BLAZOR-ONLY (blocking issues) -### Multi/rerun collections & playlist variants — API gaps #151/#152/#153 +### Playlist variant management — API gap #153 + +**#151 (multi-collections) and #152 (rerun collections) are DONE** — both now have SPA editor screens +(`/app/multi-collections`, `/app/rerun-collections`; see Section 2). The rerun editor offers the +REST-supported selection types only (Collection, MultiCollection, SmartCollection, and the media-item +types TelevisionShow/TelevisionSeason/Artist/Movie/Episode/MusicVideo/OtherVideo/Song/Image/RemoteStream); +Playlist is intentionally excluded, matching `RerunCollectionRequestMapping.IsSupportedSelectionType`. | Blazor route | File | Blocking issue | |---|---|---| -| `/media/multi-collections`(`/add`, `/{Id}/edit`) | `MultiCollections.razor`, `MultiCollectionEditor.razor` | #151 — **REST API DONE** (`MultiCollectionController`, `/api/multi-collections` CRUD + `web/src/api/multiCollections.ts`); SPA editor screen still pending (follow-up) | -| `/media/rerun-collections`(`/add`, `/{Id}/edit`) | `RerunCollections.razor`, `RerunCollectionEditor.razor` | #152 — **REST API DONE** (`RerunCollectionController`, `/api/rerun-collections` CRUD + `web/src/api/rerunCollections.ts`); SPA editor screen still pending (follow-up) | | `/media/playlists`(`/{Id}`) editing depth beyond what `/app/collections` covers | `Playlists.razor`, `PlaylistEditor.razor` | #153 (playlist variant management API) | **#155 RESOLVED** (collection-items enumeration): `GET /api/collections/{id}/items` (paged) now returns a diff --git a/docs/domain-model.md b/docs/domain-model.md index 93e824114..522a96625 100644 --- a/docs/domain-model.md +++ b/docs/domain-model.md @@ -59,8 +59,8 @@ Channel (1) ──< Playout (0..N per channel; ChannelPlayoutSource distinguishe | **Watermark** | `ChannelWatermark` image overlay; attached at channel, schedule-item, block-item, deco, or playout-item level with position/size/opacity. | `ChannelWatermark`, `DecoWatermark`, `BlockItemWatermark`, `ProgramScheduleItemWatermark` | `/app/watermarks` | | **Collection** | Manual list of media items (`CollectionItem`). | `Collection` | `/app/collections` | | **SmartCollection** | Saved search — a `Query` string, no static item list. | `SmartCollection` | `/app/collections` | -| **MultiCollection** | Combines multiple `Collection`s and/or `SmartCollection`s (with grouping via `MultiCollectionItem`/`MultiCollectionSmartItem`). | `MultiCollection` | `/app/collections` | -| **RerunCollection** | One source (collection/media item/multi/smart) with separate `FirstRunPlaybackOrder` vs `RerunPlaybackOrder`. | `RerunCollection` | `/app/collections` (blocked on API #152 per parity tracker) | +| **MultiCollection** | Combines multiple `Collection`s and/or `SmartCollection`s (with grouping via `MultiCollectionItem`/`MultiCollectionSmartItem`). | `MultiCollection` | `/app/multi-collections` (#151) | +| **RerunCollection** | One source (collection/media item/multi/smart) with separate `FirstRunPlaybackOrder` vs `RerunPlaybackOrder`. | `RerunCollection` | `/app/rerun-collections` (#152) | | **Playlist** / **PlaylistGroup** | Ordered `PlaylistItem`s; `IsSystem` flag marks built-in/non-deletable playlists and groups. | `Playlist`, `PlaylistGroup`, `PlaylistItem` | `/app/collections` | | **Media kinds** | `CollectionType` enum distinguishes container kinds (Collection/TelevisionShow/TelevisionSeason/Artist/MultiCollection/SmartCollection/Playlist/RerunFirstRun/RerunRerun/SearchQuery) from leaf media kinds (Movie/Episode/MusicVideo/OtherVideo/Song/Image/RemoteStream) plus synthetic `FakeCollection`/`FakePlaylistItem`. Concrete media entities: `Movie`, `Show`/`Season`/`Episode`, `Artist`/`MusicVideo`/`Song`, `OtherVideo`, `Image`, `RemoteStream` (`ErsatzTV.Core/Domain/MediaItem/`). | `MediaItem` subclasses | `/app/media?kind=...` | | **Library / LibraryPath / LibraryFolder** | `Library` (abstract; Local/Plex/Jellyfin/Emby subclasses) owns one or more `LibraryPath`s (scan roots); each path has a `LibraryFolder` tree used for browsing and image-folder duration metadata. | `Library`, `LibraryPath`, `LibraryFolder` | `/app/libraries` | @@ -81,7 +81,7 @@ Primary nav: `/app` (dashboard), `/app/channels`, `/app/new-channel`, `/app/guid Media nav: `/app/media` (generic kind-filtered browse, `?kind=movies|shows|artists|music-videos| other-videos|remote-streams|images`), `/app/search`, `/app/trash`, `/app/collections` (manual + -smart + multi + playlist; rerun-collection editing still gated on API #152), +smart), `/app/multi-collections` (#151), `/app/rerun-collections` (#152), `/app/filler-presets`, `/app/libraries`, `/app/trakt-lists`. System nav: `/app/settings` (sub-tabs: streaming/system/logging/playout/scanner/general/xmltv — @@ -94,8 +94,9 @@ validator; playback troubleshooting still gated on API #145), `/app/ffmpeg-profi Per-item media detail pages and the image-folder browser (`MediaDetailScreen`'s `MovieDetailScreen`/`ShowDetailScreen`/`SeasonDetailScreen`/`ArtistDetailScreen`, `ImageBrowserScreen`) landed via #141 (PR #183) at `/app/media/{movies|shows|seasons|artists}/{id}` -and `/app/media/images/browser`. Not yet in the SPA: multi/rerun-collection + playlist-variant -management (API gaps #151/#152/#153/#155). See `docs/blazor-route-parity.md` for the full +and `/app/media/images/browser`. Multi-collection (#151) and rerun-collection (#152) editors now +live in the SPA at `/app/multi-collections` and `/app/rerun-collections`. Not yet in the SPA: +playlist-variant management depth (API gap #153). See `docs/blazor-route-parity.md` for the full route-by-route tracker. ## Key handler / file locations diff --git a/web/src/App.test.tsx b/web/src/App.test.tsx index 5491331b0..2c7d36b92 100644 --- a/web/src/App.test.tsx +++ b/web/src/App.test.tsx @@ -56,6 +56,19 @@ describe('ChicoryTV SPA scaffold', () => { expect(window.location.pathname).toBe('/app/schedules'); }); + it('registers the multi-collection and rerun-collection nav entries', async () => { + render(); + + // Anchored exact names avoid matching the substring "Collections" nav entry (spa-conventions §6). + fireEvent.click(screen.getByRole('link', { name: 'Multi-Collections' })); + expect(screen.getByRole('heading', { name: 'Multi-Collections' })).toBeInTheDocument(); + expect(window.location.pathname).toBe('/app/multi-collections'); + + fireEvent.click(screen.getByRole('link', { name: 'Rerun Collections' })); + expect(screen.getByRole('heading', { name: 'Rerun Collections' })).toBeInTheDocument(); + expect(window.location.pathname).toBe('/app/rerun-collections'); + }); + it('preserves native browser behavior for modified nav link clicks', () => { render(); diff --git a/web/src/App.tsx b/web/src/App.tsx index 52c0244c1..a0173b832 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -34,6 +34,7 @@ import { Hash, HardDrive, Info, + Layers, LayoutDashboard, LayoutGrid, Library, @@ -47,6 +48,7 @@ import { Play, Radio, RefreshCw, + Repeat, ScrollText, Search, Server, @@ -69,6 +71,8 @@ import { FFmpegProfilesScreen } from './screens/FFmpegProfilesScreen'; import { FillerPresetsScreen } from './screens/FillerPresetsScreen'; import { LogsScreen } from './screens/LogsScreen'; import { MediaBrowseScreen } from './screens/MediaBrowseScreen'; +import { MultiCollectionsScreen } from './screens/MultiCollectionsScreen'; +import { RerunCollectionsScreen } from './screens/RerunCollectionsScreen'; import { ArtistDetailScreen, MovieDetailScreen, @@ -183,6 +187,8 @@ type ScreenId = | 'search' | 'trash' | 'collections' + | 'multiCollections' + | 'rerunCollections' | 'fillerPresets' | 'libraries' | 'traktLists' @@ -394,6 +400,28 @@ const routes: ScreenRoute[] = [ primaryAction: 'Add Collection', placeholder: 'Collections workspace' }, + { + id: 'multiCollections', + path: '/app/multi-collections', + label: 'Multi-Collections', + title: 'Multi-Collections', + kicker: 'Media', + description: 'Group manual and smart collections into a single schedulable collection.', + icon: