You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
2.3 KiB
109 lines
2.3 KiB
type InternalMovieData = {
|
|
/**
|
|
* Description in local language
|
|
*/
|
|
description: string;
|
|
/**
|
|
* A whole number of minutes, presumably
|
|
*/
|
|
duration: number;
|
|
id: number;
|
|
imdbId: string;
|
|
/**
|
|
* Two-letter codes
|
|
*/
|
|
languages: string[];
|
|
/**
|
|
* Two-letter code
|
|
*/
|
|
originalLanguage: string;
|
|
productionYear: number;
|
|
studios: string[];
|
|
/**
|
|
* Title in local language
|
|
*/
|
|
title: string;
|
|
userrating: {
|
|
countStar1: number;
|
|
countStar2: number;
|
|
countStar3: number;
|
|
countStar4: number;
|
|
countStar5: number;
|
|
countTotal: number;
|
|
};
|
|
};
|
|
|
|
type MovieData = {
|
|
internalId?: number;
|
|
imdbId: string;
|
|
title: string;
|
|
localTitle: string;
|
|
description: string;
|
|
localDescription: string;
|
|
posterUrl: string;
|
|
type: 'movie' | 'series';
|
|
/**
|
|
* A whole number of minutes
|
|
*/
|
|
duration: number;
|
|
totalSeasons: number;
|
|
/**
|
|
* Two-letter code
|
|
*/
|
|
originalLanguage: string;
|
|
/**
|
|
* Two-letter codes
|
|
*/
|
|
availableLanguages: string[];
|
|
productionYear: number;
|
|
releaseDate: string;
|
|
dvdReleaseDate: string;
|
|
genres: string[];
|
|
directors: string[];
|
|
writers: string[];
|
|
actors: string[];
|
|
studios: string[];
|
|
awards: string;
|
|
productionCountries: string[];
|
|
boxOffice: string;
|
|
contentRating: string;
|
|
website: string;
|
|
ratings: {
|
|
source: string;
|
|
value: string;
|
|
}[];
|
|
};
|
|
|
|
export type StrictPartial<
|
|
T,
|
|
TForbiddenKeys extends keyof T,
|
|
TOptionalKeys extends Exclude<keyof T, TForbiddenKeys>,
|
|
> = Omit<T, TForbiddenKeys | TOptionalKeys> & Partial<Pick<T, TOptionalKeys>>;
|
|
|
|
export type NormalizedOmdbData = StrictPartial<
|
|
MovieData,
|
|
| 'availableLanguages'
|
|
| 'localDescription'
|
|
| 'localTitle'
|
|
| 'originalLanguage'
|
|
| 'studios',
|
|
| 'boxOffice'
|
|
| 'contentRating'
|
|
| 'directors'
|
|
| 'dvdReleaseDate'
|
|
| 'totalSeasons'
|
|
| 'website'
|
|
>;
|
|
|
|
export type InternalMoviesProvider = {
|
|
getMovieMetadataByInternalId(
|
|
internalId: number,
|
|
): Promise<InternalMovieData | undefined>;
|
|
getMovieMetadataByImdbId(
|
|
imdbId: string,
|
|
): Promise<InternalMovieData | undefined>;
|
|
};
|
|
|
|
export type OmdbProvider = {
|
|
getMetadata(imdbId: string): Promise<NormalizedOmdbData | undefined>;
|
|
};
|
|
|