fix(backend): include EpisodeSeen in season episodes and add entry credits endpoint

- Add getEntryCredits service method returning all cast + crew with People, ordered by cast_type, order, episode_count
- Add getEntryCredits controller method
- Add GET /entries/:id/credits route in entry.routes.js
- Include EpisodeSeen association in getSeasonEpisodes so seen dates are returned to frontend
This commit is contained in:
Mohammed Abad committed 2026-04-29 16:04:10 +01:00
1 parent e460290b9b
commit 22d111ef71
7 files changed
+51 -3

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ Entry CRUD and management.
| `refresh(id)` | PUT | `/entries/:id/refresh` |
| `fetchCollection(id)` | PUT | `/entries/:id/fetch-collection` |
| `getSeasons(id)` | GET | `/entries/:id/seasons` |
| `getCredits(id)` | GET | `/entries/:id/credits` |
| `syncSeries()` | GET | `/entries/sync-series` |
| `uploadMedia(id, formData)` | POST | `/entries/:id/media` |
| `setMediaSelected(entryId, mediaId)` | PUT | `/entries/:entryId/media/:mediaId` |
+1
View File
@@ -29,6 +29,7 @@ All endpoints are prefixed with `/api/v1`. See [[Backend]] for server setup.
| `PUT` | `/entries/:id/ids` | Update external IDs |
| `DELETE` | `/entries/:id` | Delete entry and all related data |
| `GET` | `/entries/:id/seasons` | Get all seasons for a TV entry |
| `GET` | `/entries/:id/credits` | Get ALL credits (cast + crew) for an entry, with associated `person` populated. Used by [[Pages#EntryCastsPage\|EntryCastsPage]] |
| `PUT` | `/entries/:id/refresh` | Force refresh from TMDB |
| `PUT` | `/entries/:id/fetch-collection` | Fetch/create TMDB collection for entry |
| `GET` | `/entries/sync-series` | Batch refresh all non-ended TV series |
+3 -1
View File
@@ -74,10 +74,12 @@ Sections:
Full cast & crew grid for an entry. Route: `/entry/:id/cast`. Width: `max-w-4xl`.
- Breadcrumb: `Entry Title / Cast & Crew` (Title links back to EntryDetailsPage)
- Loads ALL credits (cast + crew) via `useEntryCredits` (`GET /entries/:id/credits`) — not limited to the 10-cast preview shown on EntryDetailsPage
- Filter: All / Cast / Crew
- Sort: Credit Order, Popularity, Name, Birthday, Gender, Episode Count (TV only)
- Sort: Credit Order, Popularity, Name, Birthday, Gender, Episodes (TV only)
- Sort direction toggle (asc/desc)
- Shows role/job label and episode count for TV series
- **Lazy loading**: renders 24 credits per chunk; an `IntersectionObserver` sentinel auto-loads the next chunk on scroll
- Links to [[Pages#PersonDetailsPage|PersonDetailsPage]]
## SeasonPage