From 35e8ca9d694aeb6c30751b0b29dc20c8cf4773c6 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 22 Mar 2026 00:19:18 +0100 Subject: [PATCH] Fix video modal for guessed specials --- front/src/ui/admin/videos-modal/index.tsx | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/front/src/ui/admin/videos-modal/index.tsx b/front/src/ui/admin/videos-modal/index.tsx index 224a5a1e..28bc856e 100644 --- a/front/src/ui/admin/videos-modal/index.tsx +++ b/front/src/ui/admin/videos-modal/index.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { useTranslation } from "react-i18next"; import { View } from "react-native"; -import { type Entry, FullVideo, type Page } from "~/models"; +import { type Entry, type Episode, FullVideo, type Page } from "~/models"; import { Modal, P } from "~/primitives"; import { InfiniteFetch, @@ -32,17 +32,17 @@ export const useEditLinks = ( body: [ { id: video, - for: entries.map((x) => - x.kind === "episode" && !x.slug - ? { - serie: slug, - // @ts-expect-error: idk why it couldn't match x as an episode - season: x.seasonNumber, - // @ts-expect-error: idk why it couldn't match x as an episode - episode: x.episodeNumber, - } - : { slug: x.slug }, - ), + for: entries.map((x) => { + if (x.slug) return { slug: x.slug }; + const ep = x as Episode; + if (ep.seasonNumber === 0) + return { serie: slug, special: ep.episodeNumber }; + return { + serie: slug, + season: ep.seasonNumber, + episoed: ep.episodeNumber, + }; + }), }, ], }),