feat: Series recommendations and styling

This commit is contained in:
Aleksi Lassila
2024-04-16 18:11:35 +03:00
parent 32bde1ff9e
commit 9d647c0ae2
11 changed files with 162 additions and 25 deletions

View File

@@ -5,7 +5,6 @@ import { TMDB_API_KEY, TMDB_BACKDROP_SMALL } from '../../constants';
import { settings } from '../../stores/settings.store';
import type { TitleType } from '../../types';
import type { Api } from '../api.interface';
import { appState } from '../../stores/app-state.store';
const CACHE_ONE_DAY = 'max-age=86400';
const CACHE_FOUR_DAYS = 'max-age=345600';
@@ -19,6 +18,9 @@ export type TmdbSeason =
export type TmdbEpisode = NonNullable<TmdbSeason['episodes']>[0];
export type TmdbPerson =
operations['person-details']['responses']['200']['content']['application/json'];
export type TmdbCredit =
| NonNullable<TmdbSeriesFull2['aggregate_credits']['cast']>[0]
| NonNullable<TmdbMovieFull2['credits']['cast']>[0];
export interface TmdbPersonFull extends TmdbPerson {
images: operations['person-images']['responses']['200']['content']['application/json'];
@@ -165,6 +167,15 @@ export class TmdbApi implements Api<paths> {
}
}).then((res) => res.data?.results || []);
getSeriesRecommendations = (tmdbId: number) =>
TmdbApiOpen.GET('/3/tv/{series_id}/recommendations', {
params: {
path: {
series_id: tmdbId
}
}
}).then((res) => res.data?.results || []);
// OTHER
}