added find endpoint and types

This commit is contained in:
DerPenz
2023-02-23 18:44:26 +01:00
parent f75321e6a6
commit 4efa4a7354
5 changed files with 47 additions and 0 deletions

29
src/types/find.ts Normal file
View File

@@ -0,0 +1,29 @@
import { ParsedUrlQueryInput } from 'querystring';
import { Episode, Media, MediaType, Movie, Person, Season, TV } from '.';
export type ExternalSource =
| 'imdb_id'
| 'freebase_mid'
| 'freebase_id'
| 'tvdb_id'
| 'tvrage_id'
| 'facebook_id'
| 'twitter_id'
| 'instagram_id';
export interface ExternalIdOptions extends ParsedUrlQueryInput {
external_source: ExternalSource;
language?: string;
}
type MediaTagged<T> = T & {
media_type: MediaType;
};
export interface FindResult {
movie_results: MediaTagged<Movie>[];
person_results: MediaTagged<Person>[];
tv_results: MediaTagged<TV>[];
tv_episode_results: MediaTagged<Episode>[];
tv_season_results: MediaTagged<Season & { show_id: string }>[];
}