-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
64 lines (57 loc) · 2.32 KB
/
Copy pathtypes.ts
File metadata and controls
64 lines (57 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// A single watch provider (streaming service / storefront) for a title in a
// given region, as surfaced by TMDB's /watch/providers endpoint.
export interface WatchProvider {
name: string;
logoPath: string | null;
// Which TMDB buckets this provider appeared in. Subscription-style buckets
// (flatrate/free/ads) rank ahead of transactional ones (rent/buy).
kinds: ('flatrate' | 'free' | 'ads' | 'rent' | 'buy')[];
}
export interface Movie {
id: number;
title: string;
poster_path: string | null;
backdrop_path: string | null;
overview: string;
vote_average: number;
release_date: string;
genre_ids: number[];
media_type?: 'movie' | 'tv';
// Real subscription platform name from TMDB watch providers API
// (e.g. 'Netflix', 'Prime Video'), or sentinel values:
// 'Rent/Buy' -> only available transactionally (rent or buy)
// 'Theatre' -> released within last 60 days, no streaming yet
// undefined -> no availability info known
// NOTE: this remains the primary badge field and keeps the sentinel
// contract exactly as before, so alert logic and color coding are unchanged.
platform?: string;
// Full, ordered list of relevant providers with logos (subscription first,
// then rent/buy). Optional/additive — `platform` is derived from platforms[0].
platforms?: WatchProvider[];
}
export interface Genre {
id: number;
name: string;
}
export interface ApiResponse<T> {
page: number;
results: T[];
total_pages: number;
total_results: number;
}
export type SortOption = 'popularity.desc' | 'vote_average.desc' | 'release_date.desc';
// External ratings for a title (via OMDb), cached in Supabase.
export interface TitleRatings {
imdbId: string | null;
/** IMDb rating 0–10, null when unknown. */
imdb: number | null;
/** Rotten Tomatoes percentage 0–100, null when unknown. */
rt: number | null;
}
// Client-side ordering of the loaded grid.
export type GridSort = 'default' | 'imdb' | 'rt' | 'tmdb' | 'date';
// Browse filter modes. 'now_playing' surfaces theatrical releases via TMDB's
// /movie/now_playing endpoint. All others map to media_type / trending as before.
export type MediaType = 'all' | 'movie' | 'tv' | 'now_playing';
// Supported watch-provider regions for the Navbar region selector.
export type WatchRegion = 'US' | 'GB' | 'CA' | 'AU' | 'DE' | 'FR' | 'TR' | 'IN';