From afb17f09c73a626f1be929d3211a0c1879b46ab2 Mon Sep 17 00:00:00 2001 From: Burrito <37681398+burritosoftware@users.noreply.github.com> Date: Fri, 10 Mar 2023 09:43:02 +0000 Subject: [PATCH] Utilize ea3-ident instead of ea3-config for datecodes (#1) * Utilize ea3-ident instead of ea3-config for datecodes * added checks for ea3-config and ea3-ident in resource update --------- Co-authored-by: vvo <> --- sdvx@asphyxia/handlers/webui.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sdvx@asphyxia/handlers/webui.ts b/sdvx@asphyxia/handlers/webui.ts index 9b17a80..1722eeb 100644 --- a/sdvx@asphyxia/handlers/webui.ts +++ b/sdvx@asphyxia/handlers/webui.ts @@ -177,9 +177,19 @@ export const copyResourcesFromGame = async (data: {}) => { // Get new music data from music_db.xml console.log('Getting new music_db info') if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/data/others/music_db.xml")) { + let ea3Config = [] + let version = '' let mdb = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/data/others/music_db.xml"), "shift_jis"), false) - let ea3Config = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-config.xml"), "shift_jis"), false) - let version = ea3Config['ea3']['soft']['ext']['@content']; + + if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-config.xml")) { + console.log("Reading ea3-config.xml") + ea3Config = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-config.xml"), "shift_jis"), false) + version = ea3Config['ea3']['soft']['ext']['@content']; + } else if(IO.Exists(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-ident.xml")) { + console.log("Reading ea3-ident.xml") + ea3Config = U.parseXML(U.DecodeString(await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "/prop/ea3-ident.xml"), "shift_jis"), false) + version = ea3Config['ea3_conf']['soft']['ext']['@content']; + } let prevAssetMdb = [] if(IO.Exists('webui/asset/json/music_db.json')) { prevAssetMdb = JSON.parse(U.DecodeString(await IO.ReadFile('webui/asset/json/music_db.json'), 'utf8'))