mirror of
https://github.com/sct/overseerr.git
synced 2025-09-30 23:43:33 +02:00
feat(frontend/api): cast included with movie request and cast list on detail page
This commit is contained in:
@@ -1,7 +1,32 @@
|
||||
import { TmdbMovieDetails } from '../api/themoviedb';
|
||||
import {
|
||||
TmdbMovieDetails,
|
||||
TmdbCreditCast,
|
||||
TmdbCreditCrew,
|
||||
} from '../api/themoviedb';
|
||||
import { MediaRequest } from '../entity/MediaRequest';
|
||||
import { ProductionCompany, Genre } from './common';
|
||||
|
||||
export interface Cast {
|
||||
id: number;
|
||||
castId: number;
|
||||
character: string;
|
||||
creditId: string;
|
||||
gender?: number;
|
||||
name: string;
|
||||
order: number;
|
||||
profilePath?: string;
|
||||
}
|
||||
|
||||
export interface Crew {
|
||||
id: number;
|
||||
creditId: string;
|
||||
department: string;
|
||||
gender?: number;
|
||||
job: string;
|
||||
name: string;
|
||||
profilePath?: string;
|
||||
}
|
||||
|
||||
export interface MovieDetails {
|
||||
id: number;
|
||||
imdbId?: string;
|
||||
@@ -33,9 +58,34 @@ export interface MovieDetails {
|
||||
video: boolean;
|
||||
voteAverage: number;
|
||||
voteCount: number;
|
||||
credits: {
|
||||
cast: Cast[];
|
||||
crew: Crew[];
|
||||
};
|
||||
request?: MediaRequest;
|
||||
}
|
||||
|
||||
const mapCast = (person: TmdbCreditCast): Cast => ({
|
||||
castId: person.cast_id,
|
||||
character: person.character,
|
||||
creditId: person.credit_id,
|
||||
id: person.id,
|
||||
name: person.name,
|
||||
order: person.order,
|
||||
gender: person.gender,
|
||||
profilePath: person.profile_path,
|
||||
});
|
||||
|
||||
const mapCrew = (person: TmdbCreditCrew): Crew => ({
|
||||
creditId: person.credit_id,
|
||||
department: person.department,
|
||||
id: person.id,
|
||||
job: person.job,
|
||||
name: person.name,
|
||||
gender: person.gender,
|
||||
profilePath: person.profile_path,
|
||||
});
|
||||
|
||||
export const mapMovieDetails = (
|
||||
movie: TmdbMovieDetails,
|
||||
request?: MediaRequest
|
||||
@@ -69,5 +119,9 @@ export const mapMovieDetails = (
|
||||
posterPath: movie.poster_path,
|
||||
runtime: movie.runtime,
|
||||
tagline: movie.tagline,
|
||||
credits: {
|
||||
cast: movie.credits.cast.map(mapCast),
|
||||
crew: movie.credits.crew.map(mapCrew),
|
||||
},
|
||||
request,
|
||||
});
|
||||
|
Reference in New Issue
Block a user