7 changed files with 118 additions and 135 deletions
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
export type JWContentTypes = "movie" | "show"; |
||||
|
||||
export type JWSearchQuery = { |
||||
content_types: JWContentTypes[]; |
||||
page: number; |
||||
page_size: number; |
||||
query: string; |
||||
}; |
||||
|
||||
export type JWPage<T> = { |
||||
items: T[]; |
||||
page: number; |
||||
page_size: number; |
||||
total_pages: number; |
||||
total_results: number; |
||||
}; |
||||
|
||||
export const JW_API_BASE = "https://apis.justwatch.com"; |
||||
export const JW_IMAGE_BASE = "https://images.justwatch.com"; |
||||
|
||||
export type JWSeasonShort = { |
||||
title: string; |
||||
id: number; |
||||
season_number: number; |
||||
}; |
||||
|
||||
export type JWEpisodeShort = { |
||||
title: string; |
||||
id: number; |
||||
episode_number: number; |
||||
}; |
||||
|
||||
export type JWMediaResult = { |
||||
title: string; |
||||
poster?: string; |
||||
id: number; |
||||
original_release_year?: number; |
||||
jw_entity_id: string; |
||||
object_type: JWContentTypes; |
||||
seasons?: JWSeasonShort[]; |
||||
}; |
||||
|
||||
export type JWSeasonMetaResult = { |
||||
title: string; |
||||
id: string; |
||||
season_number: number; |
||||
episodes: JWEpisodeShort[]; |
||||
}; |
||||
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
export enum MWMediaType { |
||||
MOVIE = "movie", |
||||
SERIES = "series", |
||||
ANIME = "anime", |
||||
} |
||||
|
||||
export type MWSeasonMeta = { |
||||
id: string; |
||||
number: number; |
||||
title: string; |
||||
}; |
||||
|
||||
export type MWSeasonWithEpisodeMeta = { |
||||
id: string; |
||||
number: number; |
||||
title: string; |
||||
episodes: { |
||||
id: string; |
||||
number: number; |
||||
title: string; |
||||
}[]; |
||||
}; |
||||
|
||||
type MWMediaMetaBase = { |
||||
title: string; |
||||
id: string; |
||||
year?: string; |
||||
poster?: string; |
||||
}; |
||||
|
||||
type MWMediaMetaSpecific = |
||||
| { |
||||
type: MWMediaType.MOVIE | MWMediaType.ANIME; |
||||
seasons: undefined; |
||||
} |
||||
| { |
||||
type: MWMediaType.SERIES; |
||||
seasons: MWSeasonMeta[]; |
||||
seasonData: MWSeasonWithEpisodeMeta; |
||||
}; |
||||
|
||||
export type MWMediaMeta = MWMediaMetaBase & MWMediaMetaSpecific; |
||||
|
||||
export interface MWQuery { |
||||
searchQuery: string; |
||||
type: MWMediaType; |
||||
} |
||||
|
||||
export interface DetailedMeta { |
||||
meta: MWMediaMeta; |
||||
imdbId?: string; |
||||
tmdbId?: string; |
||||
} |
||||
Loading…
Reference in new issue