From a57f6861c5f4acb62d5672e2042f631d0e909714 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Sun, 12 Oct 2025 22:01:35 +0800 Subject: [PATCH] fix: fixed update --- packages/music/index.ts | 14 ++++++++++++-- packages/operator/package.json | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/music/index.ts b/packages/music/index.ts index f97b663..fc8add3 100644 --- a/packages/music/index.ts +++ b/packages/music/index.ts @@ -2,7 +2,7 @@ import path from 'node:path' import { files as backgroundFiles } from '@aklive2d/background' import config from '@aklive2d/config' import { githubDownload } from '@aklive2d/downloader' -import { file } from '@aklive2d/libs' +import { envParser, file } from '@aklive2d/libs' import type { AudioDataTable, DisplayMetaTable, @@ -50,6 +50,15 @@ const download = async () => { } const generateMapping = () => { + const { mode } = envParser.parse({ + mode: { + type: 'string', + short: 'm', + }, + }) + if (mode === 'update') { + return + } const musicFolder = DATA_DIR const musicTableContent = file.readSync(MUSIC_TABLE_JSON) const musicTable: MusicTable = musicTableContent @@ -137,7 +146,8 @@ export const update = async () => { const musicData: MusicDataItem[] = metaTable.homeBackgroundData.homeBgDataList.reduce((acc, cur) => { if (cur.multiFormList.length > 1) - console.warn(`${cur.bgId} has multiple musicIds`) + // TODO: support multiple backgrounds + console.warn(`${cur.bgId} has multiple musicIds`, cur.multiFormList) acc.push({ id: cur.bgId, musicId: cur.multiFormList[0].bgMusicId, diff --git a/packages/operator/package.json b/packages/operator/package.json index 487b662..0093fe8 100644 --- a/packages/operator/package.json +++ b/packages/operator/package.json @@ -8,6 +8,7 @@ "@aklive2d/config": "workspace:*", "@aklive2d/libs": "workspace:*", "@aklive2d/official-info": "workspace:*", + "@aklive2d/downloader": "workspace:*", "unidecode": "^1.1.0", "yaml": "^2.8.1" },