feat(backend): fix credit duplicates, support multi-role TV credits, fix collection upload

- Fix credit dedup key to people_id + cast_type (scoped to entry_id)
- Detect aggregate_credits format via Array.isArray(c.roles) instead of is_tvseries flag
- Join multiple roles/jobs with "; " instead of taking only the first
- Add episode_count field to Credit model from total_episode_count
- Increase character and job columns to VARCHAR(500)
- Deselect existing collection posters/backdrops before inserting new upload
- Updated docs-vault
- Updated some agents files
This commit is contained in:
Mohammed Abad committed 2026-04-23 16:51:18 +01:00
1 parent 260282a0e2
commit ce01dc34fa
14 files changed
+293 -45

No files matched your search

+6 -2
View File
@@ -219,14 +219,18 @@ Join table for Collection ↔ Entry (M:N). Managed by hooks in `sequelizeHooks.j
| `tmdb_credit_id` | STRING(100) | |
| `adult` | BOOLEAN | Default `false` |
| `profile_path` | STRING(200) | TMDB profile image |
| `character` | STRING(100) | Role name (for cast) |
| `character` | STRING(500) | Role name(s) for cast — multiple roles joined by `"; "` |
| `order` | INTEGER | Display order |
| `episode_count` | INTEGER | Total episode count (from TMDB aggregate_credits) |
| `cast_type` | ENUM | `'cast'`, `'crew'`. Default `'cast'` |
| `department` | STRING(100) | For crew |
| `job` | STRING(100) | For crew |
| `job` | STRING(500) | Job title(s) for crew — multiple jobs joined by `"; "` |
| `entry_id` | INTEGER FK | → Entry |
| `people_id` | INTEGER FK | → People |
> [!info] TV Series Credits
> For TV series, TMDB returns `aggregate_credits` where a person can have multiple roles/jobs. These are joined with `"; "` into the `character` and `job` fields respectively. `episode_count` tracks the total episodes the person appeared in.
---
## People