- Enhance PeopleController with person credits and TMDB filmography endpoints;
- update episodeService to filter entries by showInCalendar;
- add fetchPersonCombinedCredits function in tmdbService
This commit is contained in:
Mohammed Abad committed 2026-04-01 00:07:41 +01:00
1 parent ffe7e52527
commit 11eab03987
5 files changed
+36 -7

No files matched your search

+14 -2
View File
@@ -63,8 +63,20 @@ class PeopleController {
async getPersonCredits(req, res) {
const { id } = req.params;
const credits = await _peopleService.getPersonCredits(id);
res.status(200).json(credits);
const person = await _peopleService.getPersonById(id);
if (!person) return res.status(404).json({ message: 'Person not found' });
res.status(200).json(person.roles ?? []);
}
async getPersonTmdbFilmography(req, res) {
const { id } = req.params;
const person = await _peopleService.getPersonById(id);
if (!person || !person.tmdb_id) {
return res.status(404).json({ message: 'Person not found or missing TMDB ID' });
}
const data = await tmdbService.fetchPersonCombinedCredits(person.tmdb_id);
if (!data) return res.status(500).json({ message: 'Failed to fetch filmography from TMDB' });
res.status(200).json(data);
}
async refreshPerson(req, res) {