From bd377db39ba42ac644300d09721d716319633993 Mon Sep 17 00:00:00 2001 From: Borewit Date: Sun, 8 Sep 2019 08:28:25 +0200 Subject: [PATCH] Fix parsing picture in metadata --- src/plugins/qmc.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmc.js b/src/plugins/qmc.js index 29fd7b8..984bb00 100644 --- a/src/plugins/qmc.js +++ b/src/plugins/qmc.js @@ -66,9 +66,10 @@ async function Decrypt(file) { const filename = artist + " - " + title + "." + new_ext; // 处理无封面 let pic_url = ""; - if (tag.tags.picture !== undefined) { - let pic = new Blob([new Uint8Array(tag.tags.picture.data)], {type: tag.tags.picture.format}); - pic_url = URL.createObjectURL(pic); + if (tag.common.picture !== undefined && tag.common.picture.length >= 1) { + const picture = tag.common.picture[0]; + const blobPic = new Blob([picture.data], {type: picture.format}); + pic_url = URL.createObjectURL(blobPic); } // 返回 return {