From 0b52a0acb2372c3accc9e0e13bb2eddac9a8bc44 Mon Sep 17 00:00:00 2001 From: MengYX Date: Mon, 6 Apr 2020 12:53:16 +0800 Subject: [PATCH] Fix GBK Detect Bug --- src/decrypt/qmc.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/decrypt/qmc.js b/src/decrypt/qmc.js index e558ad3..c692c0d 100644 --- a/src/decrypt/qmc.js +++ b/src/decrypt/qmc.js @@ -42,13 +42,14 @@ export async function Decrypt(file, raw_filename, raw_ext) { let musicBlob = new Blob([musicDecoded], {type: mime}); const musicMeta = await musicMetadata.parseBlob(musicBlob); - let isGbk = musicMeta.native["ID3v2.3"] - .some(item => item.id === "TCON" && item.value === "(12)"); - if (isGbk) { - musicMeta.common.artist = decode(musicMeta.common.artist, "gbk"); - musicMeta.common.title = decode(musicMeta.common.title, "gbk"); - musicMeta.common.album = decode(musicMeta.common.album, "gbk"); + for (let metaIdx in musicMeta.native) { + if (musicMeta.native[metaIdx].some(item => item.id === "TCON" && item.value === "(12)")) { + musicMeta.common.artist = decode(musicMeta.common.artist, "gbk"); + musicMeta.common.title = decode(musicMeta.common.title, "gbk"); + musicMeta.common.album = decode(musicMeta.common.album, "gbk"); + } } + //todo: Use artists list to replace artist const info = GetFileInfo(musicMeta.common.artist, musicMeta.common.title, raw_filename); if (handler.detect) reportKeyUsage(keyData, seed.Matrix128,