diff --git a/src/lib/apis/tmdb/tmdb-api.ts b/src/lib/apis/tmdb/tmdb-api.ts index eebbdab..d3215a9 100644 --- a/src/lib/apis/tmdb/tmdb-api.ts +++ b/src/lib/apis/tmdb/tmdb-api.ts @@ -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[0]; export type TmdbPerson = operations['person-details']['responses']['200']['content']['application/json']; +export type TmdbCredit = + | NonNullable[0] + | NonNullable[0]; export interface TmdbPersonFull extends TmdbPerson { images: operations['person-images']['responses']['200']['content']['application/json']; @@ -165,6 +167,15 @@ export class TmdbApi implements Api { } }).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 } diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index ec99fcc..83587c2 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -37,7 +37,7 @@ {/if} -
+
{#if $$slots['icon-after']} diff --git a/src/lib/components/Card/TmdbCard.svelte b/src/lib/components/Card/TmdbCard.svelte index d29d60d..8e7a4dd 100644 --- a/src/lib/components/Card/TmdbCard.svelte +++ b/src/lib/components/Card/TmdbCard.svelte @@ -1,19 +1,35 @@ - + diff --git a/src/lib/components/Carousel/Carousel.svelte b/src/lib/components/Carousel/Carousel.svelte index cf3bf53..bb50c6c 100644 --- a/src/lib/components/Carousel/Carousel.svelte +++ b/src/lib/components/Carousel/Carousel.svelte @@ -6,7 +6,7 @@ import { PLATFORM_TV } from '../../constants'; export let gradientFromColor = 'from-secondary-500'; - export let heading = ''; + export let hideControls = false; let carousel: HTMLDivElement | undefined; let scrollX = 0; @@ -15,15 +15,18 @@
- -
{heading}
-
+
+ +
@@ -49,6 +52,7 @@
*]:p-4 -mx-4 w-full', scrollClass )} bind:this={carousel} diff --git a/src/lib/components/PersonCard/PersonCard.svelte b/src/lib/components/PersonCard/PersonCard.svelte new file mode 100644 index 0000000..7a56736 --- /dev/null +++ b/src/lib/components/PersonCard/PersonCard.svelte @@ -0,0 +1,58 @@ + + + + { + // if (openInModal) { + // openTitleModal({ type, id: tmdbId, provider: 'tmdb' }); + // } else { + // window.location.href = `/${type}/${tmdbId}`; + // } + }} + on:enter + bind:hasFocus + > + + + + + + + + + +
+
+

{subtitle}

+

+ {name} +

+
+ + diff --git a/src/lib/components/PersonCard/TmdbPersonCard.svelte b/src/lib/components/PersonCard/TmdbPersonCard.svelte new file mode 100644 index 0000000..79aef90 --- /dev/null +++ b/src/lib/components/PersonCard/TmdbPersonCard.svelte @@ -0,0 +1,22 @@ + + + diff --git a/src/lib/components/SeriesPage/EpisodeCarousel.svelte b/src/lib/components/SeriesPage/EpisodeCarousel.svelte index 49dde6a..929053b 100644 --- a/src/lib/components/SeriesPage/EpisodeCarousel.svelte +++ b/src/lib/components/SeriesPage/EpisodeCarousel.svelte @@ -90,7 +90,7 @@ '-translate-y-20': scrollTop < 140 })} > - + jellyfinApi.getLibraryItemFromTmdbId(id), id ); + const { promise: recommendations } = useRequest(tmdbApi.getSeriesRecommendations, Number(id)); const { data: jellyfinEpisodes } = useDependantRequest( jellyfinApi.getJellyfinEpisodes, jellyfinItemData, @@ -199,7 +204,7 @@
- + + + {#await $tmdbSeries then series} + +
Show Cast
+ {#each series?.aggregate_credits?.cast?.slice(0, 15) || [] as credit} + + {/each} +
+ {/await} + {#await $recommendations then recommendations} + +
Recommendations
+ {#each recommendations || [] as recommendation} + + {/each} +
+ {/await} + More info +
diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 971f041..226449a 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -4,6 +4,7 @@ export const TMDB_IMAGES_ORIGINAL = 'https://www.themoviedb.org/t/p/original'; export const TMDB_BACKDROP_SMALL = 'https://www.themoviedb.org/t/p/w780'; export const TMDB_POSTER_SMALL = 'https://www.themoviedb.org/t/p/w342'; export const TMDB_PROFILE_SMALL = 'https://www.themoviedb.org/t/p/w185'; +export const TMDB_PROFILE_LARGE = 'https://www.themoviedb.org/t/p/h632'; export const PLACEHOLDER_BACKDROP = '/plcaeholder.jpg'; diff --git a/src/lib/pages/MoviesHomePage.svelte b/src/lib/pages/MoviesHomePage.svelte index 6d9536f..345cfc5 100644 --- a/src/lib/pages/MoviesHomePage.svelte +++ b/src/lib/pages/MoviesHomePage.svelte @@ -31,7 +31,7 @@
-
+
{$isLoadingContinueWatching || ($isLoadingRecentlyAdded && !$continueWatching?.length) ? 'Loading...' : $continueWatching?.length @@ -49,13 +49,11 @@ {/each}
{:else if $recentlyAdded?.length} -
- {#each $recentlyAdded as item (item.Id)} - - - - {/each} -
+ {#each $recentlyAdded as item (item.Id)} + + + + {/each} {/if}
diff --git a/src/lib/pages/SeriesHomePage.svelte b/src/lib/pages/SeriesHomePage.svelte index 81638cd..67de0b3 100644 --- a/src/lib/pages/SeriesHomePage.svelte +++ b/src/lib/pages/SeriesHomePage.svelte @@ -79,7 +79,7 @@
-
+
{$isLoadingContinueWatching || ($isLoadingRecentlyAdded && !$continueWatching?.length) ? 'Loading...' : $continueWatching?.length