feat(api): add external ids to movie/tv response
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { TmdbCreditCast, TmdbCreditCrew } from '../api/themoviedb';
|
||||
import {
|
||||
TmdbCreditCast,
|
||||
TmdbCreditCrew,
|
||||
TmdbExternalIds,
|
||||
} from '../api/themoviedb';
|
||||
|
||||
export interface ProductionCompany {
|
||||
id: number;
|
||||
@@ -33,6 +37,17 @@ export interface Crew {
|
||||
profilePath?: string;
|
||||
}
|
||||
|
||||
export interface ExternalIds {
|
||||
imdbId?: string;
|
||||
freebaseMid?: string;
|
||||
freebaseId?: string;
|
||||
tvdbId?: number;
|
||||
tvrageId?: string;
|
||||
facebookId?: string;
|
||||
instagramId?: string;
|
||||
twitterId?: string;
|
||||
}
|
||||
|
||||
export const mapCast = (person: TmdbCreditCast): Cast => ({
|
||||
castId: person.cast_id,
|
||||
character: person.character,
|
||||
@@ -53,3 +68,14 @@ export const mapCrew = (person: TmdbCreditCrew): Crew => ({
|
||||
gender: person.gender,
|
||||
profilePath: person.profile_path,
|
||||
});
|
||||
|
||||
export const mapExternalIds = (eids: TmdbExternalIds): ExternalIds => ({
|
||||
facebookId: eids.facebook_id,
|
||||
freebaseId: eids.freebase_id,
|
||||
freebaseMid: eids.freebase_mid,
|
||||
imdbId: eids.imdb_id,
|
||||
instagramId: eids.instagram_id,
|
||||
tvdbId: eids.tvdb_id,
|
||||
tvrageId: eids.tvrage_id,
|
||||
twitterId: eids.twitter_id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user