From cb7c018cf48561694aabdffc161527f201d014b0 Mon Sep 17 00:00:00 2001 From: FintasticMan Date: Sun, 18 Aug 2024 16:11:50 +0200 Subject: [PATCH] fix: season number for named seasons --- components/ItemCardText.tsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/components/ItemCardText.tsx b/components/ItemCardText.tsx index 75b9c232..84c8e416 100644 --- a/components/ItemCardText.tsx +++ b/components/ItemCardText.tsx @@ -8,17 +8,6 @@ type ItemCardProps = { item: BaseItemDto; }; -function seasonNameToIndex(seasonName: string | null | undefined) { - if (!seasonName) return -1; - if (seasonName.startsWith("Season")) { - return parseInt(seasonName.replace("Season ", "")); - } - if (seasonName.startsWith("Specials")) { - return 0; - } - return -1; -} - export const ItemCardText: React.FC = ({ item }) => { return ( @@ -28,9 +17,7 @@ export const ItemCardText: React.FC = ({ item }) => { {item.SeriesName} - {`S${seasonNameToIndex( - item?.SeasonName, - )}:E${item.IndexNumber?.toString()}`}{" "} + {`S${item.ParentIndexNumber?.toString()}:E${item.IndexNumber?.toString()}`}{" "} {item.Name}