From 0753b67b2b99ce726d252c9f4bebbe5f2e41e05f Mon Sep 17 00:00:00 2001 From: Abdullah Khan <85450222+AbdullahDaGoat@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:42:06 -0400 Subject: [PATCH 1/5] Update tmdb.ts --- src/backend/metadata/tmdb.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/backend/metadata/tmdb.ts b/src/backend/metadata/tmdb.ts index a265b051..28c716d9 100644 --- a/src/backend/metadata/tmdb.ts +++ b/src/backend/metadata/tmdb.ts @@ -91,28 +91,14 @@ export function formatTMDBMeta( export function formatTMDBMetaToMediaItem(media: TMDBMediaResult): MediaItem { const type = TMDBMediaToMediaItemType(media.object_type); - // Define the basic structure of MediaItem - const mediaItem: MediaItem = { + return { title: media.title, id: media.id.toString(), year: media.original_release_date?.getFullYear() ?? 0, release_date: media.original_release_date, poster: media.poster, type, - seasons: undefined, }; - - // If it's a TV show, include the seasons information - if (type === "show") { - const seasons = media.seasons?.map((season) => ({ - title: season.title, - id: season.id.toString(), - number: season.season_number, - })); - mediaItem.seasons = seasons as MWSeasonMeta[]; - } - - return mediaItem; } export function TMDBIdToUrlId( From 48002d51422f9f3faa8b26f0586e7a0ac678967c Mon Sep 17 00:00:00 2001 From: Abdullah Khan <85450222+AbdullahDaGoat@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:43:00 -0400 Subject: [PATCH 2/5] Update PopupModal.tsx From 31a6360cab51506da5e1fdffb763753ed98ad18c Mon Sep 17 00:00:00 2001 From: Abdullah Khan <85450222+AbdullahDaGoat@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:43:54 -0400 Subject: [PATCH 3/5] Update PopupModal.tsx --- src/components/media/PopupModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/media/PopupModal.tsx b/src/components/media/PopupModal.tsx index a9d9bc1b..37b6d094 100644 --- a/src/components/media/PopupModal.tsx +++ b/src/components/media/PopupModal.tsx @@ -60,7 +60,8 @@ function formatRuntime(runtime: number) { export function PopupModal({ isVisible, onClose, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars + // idk just needed to add this line for commit playingTitle, media, }: PopupModalProps) { From 1802c204cd77e2778abc72020f6bf309eda40309 Mon Sep 17 00:00:00 2001 From: Abdullah Khan <85450222+AbdullahDaGoat@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:44:45 -0400 Subject: [PATCH 4/5] Update ModalEpisodeSelector.tsx --- src/components/media/ModalEpisodeSelector.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/media/ModalEpisodeSelector.tsx b/src/components/media/ModalEpisodeSelector.tsx index a5e5c727..8aaba8b3 100644 --- a/src/components/media/ModalEpisodeSelector.tsx +++ b/src/components/media/ModalEpisodeSelector.tsx @@ -28,6 +28,7 @@ export function EpisodeSelector({ language: "en-US", }, ); + // console.log("Fetched season details:", seasonDetails); setSelectedSeason(seasonDetails); } catch (err) { console.error(err); @@ -43,6 +44,7 @@ export function EpisodeSelector({ api_key: conf().TMDB_READ_API_KEY, language: "en-US", }); + // console.log("Fetched show details:", showDetails); setSeasonsData(showDetails.seasons); if (showDetails.seasons[0] === 0) { // Default to first season @@ -85,16 +87,15 @@ export function EpisodeSelector({ episode_number: number; name: string; still_path: string; - show_id: number; - id: number; + id: string; }) => ( - navigate( - `/media/tmdb-tv-${tmdbId}-${mediaTitle}/${episode.show_id}/${episode.id}`, - ) - } + onClick={() => { + const navigateUrl = `/media/tmdb-tv-${tmdbId}-${mediaTitle}/${selectedSeason.id}/${episode.id}`; + // console.log("Navigating to:", navigateUrl); + navigate(navigateUrl); + }} className="group cursor-pointer rounded-xl relative p-[0.65em] bg-background-main transition-colors duration-[0.28s] flex-shrink-0 w-48 sm:w-auto mr-2 sm:mr-0" >

- {episode.name} + E{episode.episode_number}: {episode.name}

From 74b25ca3e461c9cf12bcdc72ff67362c624b1f46 Mon Sep 17 00:00:00 2001 From: Abdullah Khan <85450222+AbdullahDaGoat@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:45:22 -0400 Subject: [PATCH 5/5] Update mediaTypes.ts --- src/utils/mediaTypes.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/mediaTypes.ts b/src/utils/mediaTypes.ts index 3a7e2d44..c81b1ac0 100644 --- a/src/utils/mediaTypes.ts +++ b/src/utils/mediaTypes.ts @@ -1,5 +1,4 @@ export interface MediaItem { - seasons: import("c:/Users/huzei/OneDrive/Desktop/Sudo-Flix/src/backend/metadata/types/mw").MWSeasonMeta[]; id: string; title: string; year?: number;