feat: Popular series hero carousel

This commit is contained in:
Aleksi Lassila
2024-04-14 00:19:38 +03:00
parent f7f70d47e2
commit 006b2cd0fb
4 changed files with 36 additions and 15 deletions

View File

@@ -156,6 +156,15 @@ export class TmdbApi implements Api<paths> {
})
.then((res) => res.data);
getPopularSeries = () =>
TmdbApiOpen.GET('/3/tv/popular', {
params: {
query: {
language: get(settings)?.language
}
}
}).then((res) => res.data?.results || []);
// OTHER
}
@@ -178,7 +187,7 @@ const getTmdbCache = async (
else {
const backdropUri = await fn();
if (backdropUri) {
cache.put(String(tmdbId), new Response(backdropUri));
await cache.put(String(tmdbId), new Response(backdropUri));
}
return backdropUri;
}
@@ -325,15 +334,6 @@ export const getTmdbMoviePoster = async (tmdbId: number) =>
/** Discover */
export const getTmdbPopularSeries = () =>
TmdbApiOpen.GET('/3/tv/popular', {
params: {
query: {
language: get(settings)?.language
}
}
}).then((res) => res.data?.results || []);
export const getTmdbNetworkSeries = (networkId: number) =>
TmdbApiOpen.GET('/3/discover/tv', {
params: {