From b8170d3df445b71bbe88234a635841a7975cc63b Mon Sep 17 00:00:00 2001 From: Sakura Knoll Date: Sat, 30 Nov 2024 17:44:30 +0900 Subject: [PATCH] Refactor compile novels script and make the game to use custom one for 7s chapter 3 --- public/novels/7s/ko-KR/api/index.json | 2 +- src/scripts/compile7sChaptersEn.ts | 4 +++- src/scripts/compile7sChaptersKr.ts | 5 +++-- src/scripts/lib/7slib.ts | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/public/novels/7s/ko-KR/api/index.json b/public/novels/7s/ko-KR/api/index.json index 9b2c006f..3d0dfdba 100644 --- a/public/novels/7s/ko-KR/api/index.json +++ b/public/novels/7s/ko-KR/api/index.json @@ -15,7 +15,7 @@ "type": "0", "start_time": "2019-02-20 20:56:31", "end_time": "2035-01-01 00:00:00", - "xml_url": "https://uploadstatic.mihoyo.com/galgame/novel/23e7ea709b675b2840e0747d0d2fa44d4c0e0d9c/chapters/fc580e9caf5ef641b27aeb2fb641290d33524778.xml", + "xml_url": "/novels/7s/ko-KR/xml/compiled-8.xml", "parts": [ { "part_id": "51", diff --git a/src/scripts/compile7sChaptersEn.ts b/src/scripts/compile7sChaptersEn.ts index 594ced10..293e92bd 100644 --- a/src/scripts/compile7sChaptersEn.ts +++ b/src/scripts/compile7sChaptersEn.ts @@ -1,3 +1,5 @@ import { compileNovel } from './lib/7slib' -compileNovel('en-US') +const chapters = [4, 6, 7, 11] + +compileNovel('en-US', chapters) diff --git a/src/scripts/compile7sChaptersKr.ts b/src/scripts/compile7sChaptersKr.ts index 672bd8b6..c330dcf0 100644 --- a/src/scripts/compile7sChaptersKr.ts +++ b/src/scripts/compile7sChaptersKr.ts @@ -1,4 +1,5 @@ import { compileNovel } from './lib/7slib' -compileNovel('en-US') -compileNovel('ko-KR') +const chapters = [4, 6, 7, 8, 11] + +compileNovel('ko-KR', chapters) diff --git a/src/scripts/lib/7slib.ts b/src/scripts/lib/7slib.ts index 72f08112..775be8ff 100644 --- a/src/scripts/lib/7slib.ts +++ b/src/scripts/lib/7slib.ts @@ -1,9 +1,7 @@ import fs from 'fs' import path from 'path' -const chapters = [4, 6, 7, 11] - -export function compileNovel(locale: string) { +export function compileNovel(locale: string, chapters: number[]) { const xmlDirPath = path.join( __dirname, `../../../public/novels/7s/${locale}/xml`