From 203dff8d98cf43a8ab166a7f7e394e0f4e15bee1 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 30 Nov 2019 18:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=B7=E6=88=91=E6=BA=90?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E3=80=81=E6=AD=8C=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=88=97=E8=A1=A8=E9=87=8C=E7=9A=84=E6=AD=8C=E6=9B=B2?= =?UTF-8?q?=E9=9F=B3=E8=B4=A8=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/utils/music/kw/leaderboard.js | 11 ++++++----- src/renderer/utils/music/kw/songList.js | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index cbf67e85..cb180be0 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -5,3 +5,4 @@ ### 修复 - 修复使用酷我源下载歌曲时,当歌曲无封面时下载报错的问题 +- 修复酷我源排行榜、歌单详情列表里的歌曲音质匹配问题(原来无论歌曲有无高品、无损都会显示有) diff --git a/src/renderer/utils/music/kw/leaderboard.js b/src/renderer/utils/music/kw/leaderboard.js index 1de9f1e4..76559ee4 100644 --- a/src/renderer/utils/music/kw/leaderboard.js +++ b/src/renderer/utils/music/kw/leaderboard.js @@ -116,36 +116,37 @@ export default { }) }, filterData(rawList, rawList2) { + // console.log(rawList) // console.log(rawList.length, rawList2.length) return rawList.map((item, inedx) => { let formats = item.formats.split('|') let types = [] let _types = {} - if (formats.indexOf('MP3128')) { + if (formats.includes('MP3128')) { types.push({ type: '128k', size: null }) _types['128k'] = { size: null, } } - // if (formats.indexOf('MP3192')) { + // if (formats.includes('MP3192')) { // types.push({ type: '192k', size: null }) // _types['192k'] = { // size: null, // } // } - if (formats.indexOf('MP3H')) { + if (formats.includes('MP3H')) { types.push({ type: '320k', size: null }) _types['320k'] = { size: null, } } - // if (formats.indexOf('AL')) { + // if (formats.includes('AL')) { // types.push({ type: 'ape', size: null }) // _types.ape = { // size: null, // } // } - if (formats.indexOf('ALFLAC')) { + if (formats.includes('ALFLAC')) { types.push({ type: 'flac', size: null }) _types.flac = { size: null, diff --git a/src/renderer/utils/music/kw/songList.js b/src/renderer/utils/music/kw/songList.js index 3c682e9b..d06d2330 100644 --- a/src/renderer/utils/music/kw/songList.js +++ b/src/renderer/utils/music/kw/songList.js @@ -186,19 +186,19 @@ export default { let formats = item.formats.split('|') let types = [] let _types = {} - if (formats.indexOf('MP3128')) { + if (formats.includes('MP3128')) { types.push({ type: '128k', size: null }) _types['128k'] = { size: null, } } - if (formats.indexOf('MP3H')) { + if (formats.includes('MP3H')) { types.push({ type: '320k', size: null }) _types['320k'] = { size: null, } } - if (formats.indexOf('ALFLAC')) { + if (formats.includes('ALFLAC')) { types.push({ type: 'flac', size: null }) _types.flac = { size: null,