mirror of
https://github.com/sct/overseerr.git
synced 2025-10-02 00:33:09 +02:00
feat(tv): show cast for the entire show instead of only the last season (#778)
This uses TMDb's `aggregate_credits` instead of `credits` to get the show's cast for all seasons. Fixes #775
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
ProductionCompany,
|
||||
Cast,
|
||||
Crew,
|
||||
mapCast,
|
||||
mapAggregateCast,
|
||||
mapCrew,
|
||||
ExternalIds,
|
||||
mapExternalIds,
|
||||
@@ -193,7 +193,7 @@ export const mapTvDetails = (
|
||||
: undefined,
|
||||
posterPath: show.poster_path,
|
||||
credits: {
|
||||
cast: show.credits.cast.map(mapCast),
|
||||
cast: show.aggregate_credits.cast.map(mapAggregateCast),
|
||||
crew: show.credits.crew.map(mapCrew),
|
||||
},
|
||||
externalIds: mapExternalIds(show.external_ids),
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
TmdbCreditCast,
|
||||
TmdbAggregateCreditCast,
|
||||
TmdbCreditCrew,
|
||||
TmdbExternalIds,
|
||||
TmdbVideo,
|
||||
@@ -68,6 +69,18 @@ export const mapCast = (person: TmdbCreditCast): Cast => ({
|
||||
profilePath: person.profile_path,
|
||||
});
|
||||
|
||||
export const mapAggregateCast = (person: TmdbAggregateCreditCast): Cast => ({
|
||||
castId: person.cast_id,
|
||||
// the first role is the one for which the actor appears the most as
|
||||
character: person.roles[0].character,
|
||||
creditId: person.roles[0].credit_id,
|
||||
id: person.id,
|
||||
name: person.name,
|
||||
order: person.order,
|
||||
gender: person.gender,
|
||||
profilePath: person.profile_path,
|
||||
});
|
||||
|
||||
export const mapCrew = (person: TmdbCreditCrew): Crew => ({
|
||||
creditId: person.credit_id,
|
||||
department: person.department,
|
||||
|
Reference in New Issue
Block a user