diff --git a/components/ItemCardText.tsx b/components/ItemCardText.tsx index f089ab72..3096a907 100644 --- a/components/ItemCardText.tsx +++ b/components/ItemCardText.tsx @@ -7,6 +7,17 @@ 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 ( @@ -17,9 +28,8 @@ export const ItemCardText: React.FC = ({ item }) => { style={{ flexWrap: "wrap" }} className="flex text-xs opacity-50 break-all" > - {`S${item.SeasonName?.replace( - "Season ", - "" + {`S${seasonNameToIndex( + item?.SeasonName, )}:E${item.IndexNumber?.toString()}`}{" "} {item.Name}