Small Nest.js-based project
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.

96 lines
2.1 KiB

export type MovieData = {
internalId: number;
imdbId: string;
title: string;
localTitle: string;
description: string;
localDescription: string;
posterUrl: string;
type: 'movie' | 'series' | 'episode';
seriesImdbId?: string;
episodeNumber?: number;
seasonNumber?: number;
/**
* 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 NormalizedOmdbData = Omit<
MovieData,
| 'availableLanguages'
| 'internalId'
| 'localDescription'
| 'localTitle'
| 'originalLanguage'
| 'studios'
>;
export type NormalizedInternalData = Omit<
MovieData,
| 'actors'
| 'awards'
| 'boxOffice'
| 'contentRating'
| 'description'
| 'directors'
| 'dvdReleaseDate'
| 'episodeNumber'
| 'genres'
| 'posterUrl'
| 'productionCountries'
| 'releaseDate'
| 'seasonNumber'
| 'seriesImdbId'
| 'title'
| 'totalSeasons'
| 'type'
| 'website'
| 'writers'
>;
export type InternalProvider = {
getMetadataByInternalId(
internalId: number,
): Promise<NormalizedInternalData | undefined>;
getMetadataByImdbId(
imdbId: string,
): Promise<NormalizedInternalData | undefined>;
getAllMetadata(): Promise<NormalizedInternalData[]>;
};
export type OmdbProvider = {
getMetadata(imdbId: string): Promise<NormalizedOmdbData | undefined>;
};
export type EnrichedDataService = {
getMetadataByInternalId(internalId: number): MovieData | undefined;
getMetadataByImdbId(imdbId: string): MovieData | undefined;
};