feat(backend): add TMDB preview endpoint for non-library entries

- Add GET /entries/tmdb/preview/:type/:tmdbId endpoint in entryController.js
- Fetch TMDB data via tmdbService.fetchEntryData() without persisting to DB
- Return normalized preview object with title, poster, genres, rating, season/episode counts
This commit is contained in:
Mohammed Abad committed 2026-04-27 04:03:02 +01:00
1 parent 6aa57cbe71
commit 25b645a16f
13 files changed
+199 -10

No files matched your search

+32
View File
@@ -45,3 +45,35 @@ All project milestones. See also `changes.md` in project root.
- Created [[Components#Dialogs|MarkSeasonWatchedDialog]] — dedicated dialog replacing the old two-step EpisodeSeenEditDialog + ConfirmDialog flow
- Added **Scatter Mode**: distributes episodes across a date range with even spread and live preview
- "Mark Season Watched" button on [[Pages#SeasonPage|SeasonPage]] is now always visible
---
## Milestone 002
### Backend
- Added `favorite` and `pinned` boolean fields to [[Models#People|People]] model
- Added `entry_sync_status` field to [[Models#Entry|Entry]] model
- Added `searchPeople` method to [[Services|PeopleService]] for local DB search by name
- `fetchAndSavePersonByTmdbId` now accepts `options.pinned` for manual person adds
- Added orphan people cleanup to [[Services|MaintenanceService]]: finds people with no credits and not pinned
- Added `GET /maintenance/orphan-people` and `DELETE /maintenance/orphan-people` routes
- Added `markEntriesRequireCreditsSync()` to dataInitializer — marks entries needing credit sync
### Frontend
- [[Pages#SeasonPage|SeasonPage]]: Seen button always clickable (supports multiple seen records); shows seen dates with tooltip; improved mobile responsive layout
- [[Components|EntryCard]]: Quick actions dropdown menu (Favorite, Hide, Delete, Remove from collection); non-library entries now add to library + navigate instead of opening dialog
- [[Collections|CollectionDetailsPage]]: Remove entry from collection via quick actions menu
- [[People|PersonDetailsPage]]: Error handling for missing persons; favorite toggle button
- [[People|PeoplePage]]: Debounced search, Local DB toggle, All/Favorite filter
- [[Library|LibraryPage]]: Persistent filter/search/sort state via Zustand store (`useLibraryFiltersStore`)
- Added `useUpdatePerson`, `useSearchLocalPeople`, `useRemoveEntryFromCollection` [[Hooks|hooks]]
- Added `update`, `search` methods to [[API Clients|people.ts]]
- Added orphan people endpoints to [[API Clients|maintenance.ts]]
- [[Components|EntryCard]]: Moved quick actions to top-right icon button; added all Entry Details page actions (Mark watched, Rate, Watch History, Add to collection, Refresh, Manage media, Settings) with lazy-loaded dialogs
- [[Collections|CollectionDetailsPage]]: Added sort toolbar (Order, Year, Title, Rating) with asc/desc toggle
- **Backend**: Added `GET /entries/tmdb/preview/:type/:tmdbId` — TMDB preview endpoint (no library save)
- Created [[Pages#TmdbPreviewPage|TmdbPreviewPage]] — shows TMDB entry details with "Add to Library" button; TV series shows season/episode count
- [[Components|EntryCard]]: Non-library entries now navigate to TMDB preview page instead of auto-adding to library
- Added `TmdbPreview` type, `previewTmdb` API method, `useTmdbPreview` [[Hooks|hook]]
+3
View File
@@ -52,6 +52,7 @@ The core model — represents a movie or TV series.
| `date_first_seen` | DATEONLY | |
| `date_last_seen` | DATEONLY | |
| `last_fetch` | DATEONLY | Used by [[Services#Lazy Refresh\|lazy refresh]] |
| `entry_sync_status` | STRING(50) | Nullable. e.g. `"RequireCreditsSync"` |
**Has:** [[#EntryId]] (1:1), [[#EntryRating]] (1:1), [[#EntrySeen]] (1:N), [[#Season]] (1:N), [[#Credit]] (1:N), Genres (M:N), Networks (M:N), Collections (M:N), Media (polymorphic)
@@ -258,6 +259,8 @@ See [[People]].
| `last_fetch` | DATEONLY | For lazy-fetch |
| `profile_update` | DATEONLY | |
| `fully_fetched` | BOOLEAN | Default `false` — triggers TMDB fetch when `false` |
| `favorite` | BOOLEAN | Default `false` — user-favorited person |
| `pinned` | BOOLEAN | Default `false` — manually added, excluded from orphan cleanup |
---
+30 -1
View File
@@ -11,7 +11,7 @@ aliases:
# Stores
Zustand stores in `react_frontend/src/stores/`. Two stores managing client-side state.
Zustand stores in `react_frontend/src/stores/`. Three stores managing client-side state.
---
@@ -96,3 +96,32 @@ Uses Zustand `persist` middleware:
- Storage key: `showy-theme`
- Stored in `localStorage`
- On change: toggles `dark`/`light` class on `document.documentElement`
---
## useLibraryFiltersStore
> [!info] File: `stores/useLibraryFiltersStore.ts`
Persists [[Library|LibraryPage]] filter/search/sort state across navigation so filters survive when navigating to entry details and back.
### State
| Field | Type | Description |
|---|---|---|
| `activeTab` | `FilterTab` | `'all' \| 'movies' \| 'series' \| 'watchlist'` |
| `search` | `string` | Search query |
| `sortField` | `SortField` | `'title' \| 'date_added' \| 'release_date' \| 'rating'` |
| `sortDir` | `SortDir` | `'asc' \| 'desc'` |
| `filters` | `Filters` | `{ genre: string; status: string; year: string }` |
### Actions
| Action | Description |
|---|---|
| `setActiveTab(tab)` | Set active tab filter |
| `setSearch(query)` | Set search query |
| `setSortField(field)` | Set sort field |
| `setSortDir(dir)` | Set sort direction |
| `setFilters(filters)` | Set genre/status/year filters |
| `clearFilters()` | Reset all filters to defaults |