diff --git a/src/lib/apis/tmdb/tmdb-api.ts b/src/lib/apis/tmdb/tmdb-api.ts index 315e677..c176ed2 100644 --- a/src/lib/apis/tmdb/tmdb-api.ts +++ b/src/lib/apis/tmdb/tmdb-api.ts @@ -194,22 +194,37 @@ export class TmdbApi implements Api { .then((res) => res.data); getPopularSeries = () => - TmdbApiOpen.GET('/3/tv/popular', { - params: { - query: { - language: get(settings)?.language + this.getClient() + .GET('/3/tv/popular', { + params: { + query: { + language: get(settings)?.language + } } - } - }).then((res) => res.data?.results || []); + }) + .then((res) => res.data?.results || []); getSeriesRecommendations = (tmdbId: number) => - TmdbApiOpen.GET('/3/tv/{series_id}/recommendations', { - params: { - path: { - series_id: tmdbId + this.getClient() + .GET('/3/tv/{series_id}/recommendations', { + params: { + path: { + series_id: tmdbId + } } - } - }).then((res) => res.data?.results || []); + }) + .then((res) => res.data?.results || []); + + getMovieRecommendations = (tmdbId: number) => + this.getClient() + .GET('/3/movie/{movie_id}/recommendations', { + params: { + path: { + movie_id: tmdbId + } + } + }) + .then((res) => res.data?.results || []); getEpisode = ( seriesId: number, diff --git a/src/lib/pages/MoviePage.svelte b/src/lib/pages/MoviePage.svelte index fe0dd09..f12217f 100644 --- a/src/lib/pages/MoviePage.svelte +++ b/src/lib/pages/MoviePage.svelte @@ -12,10 +12,15 @@ import DetachedPage from '../components/DetachedPage/DetachedPage.svelte'; import { openMovieMediaManager } from '../components/Modal/modal.store'; import { playerState } from '../components/VideoPlayer/VideoPlayer'; + import { scrollIntoView } from '../selectable'; + import Carousel from '../components/Carousel/Carousel.svelte'; + import TmdbPersonCard from '../components/PersonCard/TmdbPersonCard.svelte'; + import TmdbCard from '../components/Card/TmdbCard.svelte'; export let id: string; const { promise: movieDataP } = useRequest(tmdbApi.getTmdbMovie, Number(id)); + $: recommendations = tmdbApi.getMovieRecommendations(Number(id)); const { promise: jellyfinItemP } = useRequest( (id: string) => jellyfinApi.getLibraryItemFromTmdbId(id), id @@ -32,101 +37,169 @@ -
- - movie?.images.backdrops - ?.sort((a, b) => (b.vote_count || 0) - (a.vote_count || 0)) - ?.map((bd) => TMDB_IMAGES_ORIGINAL + bd.file_path || '') - .slice(0, 5) || [] - )} +
+ - -
- {#await $movieDataP then movie} - {#if movie} -
= 15 - } - )} - > - {movie?.title} -
-
-

- {new Date(movie.release_date || Date.now())?.getFullYear()} -

- - -

- {movie.vote_average?.toFixed(1)} TMDB +

+ {movie.vote_average?.toFixed(1)} TMDB +

+
+
+ {movie.overview} +
+ {/if} + {/await} + {#await Promise.all([$jellyfinItemP, $radarrItemP]) then [jellyfinItem, radarrItem]} + + {#if jellyfinItem} + + {/if} + {#if radarrItem} + + {:else} + + {/if} + {#if PLATFORM_WEB} + + + {/if} + + {/await} +
+ +
+ + {#await $movieDataP then movie} + +
Show Cast
+ {#each movie?.credits?.cast?.slice(0, 15) || [] as credit} + + {/each} +
+ {/await} + {#await recommendations then recommendations} + +
Recommendations
+ {#each recommendations || [] as recommendation} + + {/each} +
+ {/await} +
+ {#await $movieDataP then movie} + +

More Information

+
+
+
+

Directed By

+
+ {movie?.credits.crew + ?.filter((c) => c.job === 'Director') + ?.map((c) => c.name) + .join(', ')} +
-
- {movie.overview} +
+

Written By

+
+ {movie?.credits.crew + ?.filter((c) => c.job === 'Writer') + ?.map((c) => c.name) + .join(', ')} +
- {/if} - {/await} - {#await Promise.all([$jellyfinItemP, $radarrItemP]) then [jellyfinItem, radarrItem]} - - {#if jellyfinItem} - - {/if} - {#if radarrItem} - - {:else} - - {/if} - {#if PLATFORM_WEB} - - - {/if} - - {/await} -
- +
+
+
+

Languages

+
+ {movie?.spoken_languages?.map((language) => language.name).join(', ')} +
+
+
+

Release Date

+
+ {new Date(movie?.release_date || 0).toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric' + })} +
+
+
+
+
+ {/await}