From 25f7f6df91ca4e58c57dbd32ad1af74ab3a9a8fa Mon Sep 17 00:00:00 2001 From: Outvi V Date: Sun, 21 Jul 2024 00:14:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(stories):=20=E6=98=9F=E7=A9=BA=E7=BC=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/stories/StoriesItem.tsx | 16 +++------------- data/stories.ts | 24 ++++++++++++++++++++++++ locales/zh-Hans/stories.json | 1 + 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/components/stories/StoriesItem.tsx b/components/stories/StoriesItem.tsx index ed63524e..7d2ad1d2 100644 --- a/components/stories/StoriesItem.tsx +++ b/components/stories/StoriesItem.tsx @@ -1,10 +1,10 @@ -import { Button, Skeleton } from '@mantine/core' +import { Button } from '@mantine/core' import { useLocale } from 'next-intl' import { getTranslations } from 'next-intl/server' import { Link } from '#utils/navigation' import { toVideoLink } from '#components/ExternalVideo' -import type { SeriesName } from '#data/stories' +import { Prefix, type SeriesName } from '#data/stories' import AssetImage from '#components/AssetImage' import { fetchApi } from '#utils/fetchApi' import storiesData from '#data/videos/stories.data' @@ -18,17 +18,7 @@ type PropType = { function getBackendStoryId(props: PropType): string { const { series, season, chapter } = props - const Prefix: Record = { - Hoshimi: 'st-original-cmn-01', - Tokyo: 'st-main-cmn-01', - Big4: 'st-main-cmn-02', - TRINITYAiLE: 'st-group-tri-01', - LizNoir: 'st-group-liz-01', - Mana: 'st-group-mna-01', - ThreeX: 'st-group-thrx-01', - Tsuki: 'st-group-moon-01', - Sunny: 'st-group-sun-01', - } + return [ Prefix[series], String(season).padStart(2, '0'), diff --git a/data/stories.ts b/data/stories.ts index 4d515b12..f6d77219 100644 --- a/data/stories.ts +++ b/data/stories.ts @@ -1,7 +1,16 @@ +/** + * To add a story series, please add: + * + * * `Series` below + * * `Episodes` below + * * `Prefix` below + */ + export const Series = [ 'Hoshimi', 'Tokyo', 'Big4', + 'Stellar', 'TRINITYAiLE', 'LizNoir', 'Mana', @@ -19,6 +28,8 @@ export const Episodes: Record = { Tokyo: [25, 44], // FIN // adv_main_03_ Big4: [66], // FIN + // adv_main_04_ + Stellar: [5], // adv_group_tri_ TRINITYAiLE: [30], // FIN // adv_group_liz_ @@ -32,3 +43,16 @@ export const Episodes: Record = { // adv_group_sun Sunny: [5, 5, 5], } + +export const Prefix: Record = { + Hoshimi: 'st-original-cmn-01', + Tokyo: 'st-main-cmn-01', + Big4: 'st-main-cmn-02', + Stellar: 'st-main-cmn-03', + TRINITYAiLE: 'st-group-tri-01', + LizNoir: 'st-group-liz-01', + Mana: 'st-group-mna-01', + ThreeX: 'st-group-thrx-01', + Tsuki: 'st-group-moon-01', + Sunny: 'st-group-sun-01', +} diff --git a/locales/zh-Hans/stories.json b/locales/zh-Hans/stories.json index 9733b8be..0a077482 100644 --- a/locales/zh-Hans/stories.json +++ b/locales/zh-Hans/stories.json @@ -6,6 +6,7 @@ "series": { "Hoshimi": "星见编", "Tokyo": "东京编", + "Stellar": "星空编", "Big4": "BIG4编", "TRINITYAiLE": "TRINITYAiLE", "LizNoir": "LizNoir",