rm Credit- & ListTypes, added enum for genre & production status

Removed types refering to other interfaces, most times we just want to
use MediaTypes which is enum values for supported types.
Also expanded on IMovie & IShow to match api response
This commit is contained in:
2022-08-11 18:34:24 +02:00
parent 09a25e0f37
commit f7fe582200

View File

@@ -18,21 +18,68 @@ export interface IPersonCredits {
type?: string;
}
export type MediaTypes = IMovie | IShow | IPerson | IRequest;
export type CreditTypes = ICast | ICrew;
export type ListResults = Array<MediaTypes>;
export type ListResults = Array<IMovie | IShow | IPerson | IRequest>;
export enum ListTypes {
export enum MediaTypes {
Movie = "movie",
Show = "show",
Person = "person",
Request = "request"
Person = "person"
}
export enum RequestTypes {
Requested = "requested"
}
export enum MovieGenres {
Action = "Action",
Adventure = "Adventure",
Animation = "Animation",
Comedy = "Comedy",
Crime = "Crime",
Documentary = "Documentary",
Drama = "Drama",
Family = "Family",
Fantasy = "Fantasy",
History = "History",
Horror = "Horror",
Music = "Music",
Mystery = "Mystery",
Romance = "Romance",
Science_Fiction = "Science Fiction",
TV_Movie = "TV Movie",
Thriller = "Thriller",
War = "War",
Western = "Western"
}
export enum MovieProductionStatus {
Rumored = "Rumored",
Planned = "Planned",
In_Production = "In Production",
Post_Production = "Post Production",
Released = "Released",
Canceled = "Canceled"
}
export enum ShowGenres {
Action_Adventure = "Action & Adventure",
Animation = "Animation",
Comedy = "Comedy",
Crime = "Crime",
Documentary = "Documentary",
Drama = "Drama",
Family = "Family",
Kids = "Kids",
Mystery = "Mystery",
News = "News",
Reality = "Reality",
SciFi_Fantasy = "Sci-Fi & Fantasy",
Soap = "Soap",
Talk = "Talk",
War_Politics = "War & Politics",
Western = "Western"
}
export interface IMovie {
id: number;
title: string;
@@ -42,8 +89,14 @@ export interface IMovie {
backdrop: string;
release_date: string | Date;
rating: number;
genres: Array<MovieGenres>;
production_status: MovieProductionStatus;
tagline: string;
runtime: number;
popularity?: number;
type: ListTypes.Movie;
imdb_db: string;
exists_in_plex?: boolean;
type: MediaTypes.Movie;
}
export interface IShow {
@@ -51,16 +104,17 @@ export interface IShow {
title: string;
year: number;
overview: string;
tagline?: string;
poster: string;
backdrop: string;
seasons?: number;
episodes?: number;
popularity?: number;
genres?: Array<string>;
genres?: Array<ShowGenres>;
production_status?: string;
runtime?: Array<number>;
exists_in_plex?: boolean;
type: ListTypes.Show;
type: MediaTypes.Show;
}
export interface IPerson {
@@ -69,9 +123,11 @@ export interface IPerson {
poster: string;
birthday: string | null;
deathday: string | null;
place_of_birth?: string;
biography?: string;
known_for_department: string;
adult: boolean;
type: ListTypes.Person;
type: MediaTypes.Person;
}
export interface IRequest extends IMovie {