From a62d8304e2ed28c3e5c1c549140debb7e8ad9605 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 29 Apr 2020 12:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=E5=8F=AF=E7=94=A8=E9=9F=B3?= =?UTF-8?q?=E8=B4=A8=E6=8E=A7=E5=88=B6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 30 +++++++++---------- package.json | 6 ++-- publish/changeLog.md | 2 +- src/renderer/App.vue | 3 ++ src/renderer/components/core/Player.vue | 29 +++++++----------- .../components/material/DownloadModal.vue | 14 +++------ src/renderer/components/material/SongList.vue | 18 +++++------ .../lang/cns/material/download_modal.json | 2 +- .../lang/cnt/material/download_modal.json | 2 +- .../lang/en/material/download_modal.json | 2 +- src/renderer/store/modules/download.js | 1 + src/renderer/utils/index.js | 3 ++ src/renderer/utils/music/api-source.js | 25 ++++++++++++---- src/renderer/utils/music/bd/index.js | 8 ++--- src/renderer/utils/music/index.js | 4 +++ src/renderer/utils/music/kg/index.js | 8 ++--- src/renderer/utils/music/kw/index.js | 4 +-- src/renderer/utils/music/mg/index.js | 4 +-- src/renderer/utils/music/tx/index.js | 6 ++-- src/renderer/utils/music/utils.js | 11 ++----- src/renderer/utils/music/wy/index.js | 4 +-- src/renderer/utils/music/xm/index.js | 4 +-- src/renderer/views/Leaderboard.vue | 12 +------- src/renderer/views/List.vue | 16 +++++----- src/renderer/views/Search.vue | 21 +++++++------ src/renderer/views/SongList.vue | 21 +++++-------- 26 files changed, 127 insertions(+), 133 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee4db4ed..2c8b8d95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1217,9 +1217,9 @@ "dev": true }, "@types/uglify-js": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.0.5.tgz", - "integrity": "sha512-L7EbSkhSaWBpkl+PZAEAqZTqtTeIsq7s/oX/q0LNnxxJoRVKQE0T81XDVyaxjiiKQwiV2vhVeYRqxdRNqGOGJw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.9.0.tgz", + "integrity": "sha512-3ZcoyPYHVOCcLpnfZwD47KFLr8W/mpUcgjpf1M4Q78TMJIw7KMAHSjiCLJp1z3ZrBR9pTLbe191O0TldFK5zcw==", "dev": true, "requires": { "source-map": "^0.6.1" @@ -1234,9 +1234,9 @@ } }, "@types/webpack": { - "version": "4.41.10", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.10.tgz", - "integrity": "sha512-vIy0qaq8AjOjZLuFPqpo7nAJzcoVXMdw3mvpNN07Uvdy0p1IpJeLNBe3obdRP7FX2jIusDE7z1pZa0A6qYUgnA==", + "version": "4.41.12", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.12.tgz", + "integrity": "sha512-BpCtM4NnBen6W+KEhrL9jKuZCXVtiH6+0b6cxdvNt2EwU949Al334PjQSl2BeAyvAX9mgoNNG21wvjP3xZJJ5w==", "dev": true, "requires": { "@types/anymatch": "*", @@ -5339,9 +5339,9 @@ "dev": true }, "electron": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/electron/-/electron-8.2.3.tgz", - "integrity": "sha512-FJUp103c8yJBoAaj/QM/OBde57iJh95u1yGJBytMUXmLFSsx78LmNE03QN4XCODyzi76IEcasvUcK6scogRLbQ==", + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/electron/-/electron-8.2.4.tgz", + "integrity": "sha512-Lle0InIgSAHZxD5KDY0wZ1A2Zlc6GHwMhAxoHMzn05mndyP1YBkCYHc0TDDofzUTrsLFofduPjlknO5Oj9fTPA==", "dev": true, "requires": { "@electron/get": "^1.0.1", @@ -5350,9 +5350,9 @@ }, "dependencies": { "@types/node": { - "version": "12.12.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.36.tgz", - "integrity": "sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ==", + "version": "12.12.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.37.tgz", + "integrity": "sha512-4mXKoDptrXAwZErQHrLzpe0FN/0Wmf5JRniSVIdwUrtDf9wnmEV1teCNLBo/TwuXhkK/bVegoEn/wmb+x0AuPg==", "dev": true } } @@ -8427,9 +8427,9 @@ } }, "html-webpack-plugin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.2.0.tgz", - "integrity": "sha512-zL7LYTuq/fcJX6vV6tmmvFR508Bd9e6kvVGbS76YAjZ2CPVRzsjkvDYs/SshPevpolSdTWgaDV39D6k6oQoVFw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.2.1.tgz", + "integrity": "sha512-zTTPxKJ8bgRe4RVDzT1MZW8ysW5wwDfJmD3AN+7mw2MKMWZJibZzBgHaDqnL6FJg1kvk38sQPMJNmI8Q1Ntr9A==", "dev": true, "requires": { "@types/html-minifier-terser": "^5.0.0", diff --git a/package.json b/package.json index 51149091..d9eba389 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-formatter-friendly --fix src" }, "browserslist": [ - "Electron 8.2.3" + "Electron 8.2.4" ], "engines": { "node": ">= 12" @@ -160,7 +160,7 @@ "cross-env": "^7.0.2", "css-loader": "^3.5.3", "del": "^5.1.0", - "electron": "^8.2.3", + "electron": "^8.2.4", "electron-builder": "^22.5.1", "electron-debug": "^3.0.1", "electron-devtools-installer": "^3.0.0", @@ -175,7 +175,7 @@ "eslint-plugin-standard": "^4.0.1", "file-loader": "^6.0.0", "friendly-errors-webpack-plugin": "^1.7.0", - "html-webpack-plugin": "^4.2.0", + "html-webpack-plugin": "^4.2.1", "less": "^3.11.1", "less-loader": "^6.0.0", "markdown-it": "^10.0.0", diff --git a/publish/changeLog.md b/publish/changeLog.md index b61ee280..2e186d23 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -34,5 +34,5 @@ ### 其他 -更新 Electron 到 8.2.3 +更新 Electron 到 8.2.4 diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 19f74dcd..ea1117a2 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -44,6 +44,7 @@ export default { apiSource: 'test', proxy: {}, isShowPact: false, + qualityList: {}, xm: { isShowVerify: false, }, @@ -121,6 +122,7 @@ export default { this.saveSearchHistoryList(n) }, 'globalObj.apiSource'(n) { + this.globalObj.qualityList = music.supportQuality[n] if (n != this.setting.apiSource) { this.setSetting(Object.assign({}, this.setting, { apiSource: n, @@ -196,6 +198,7 @@ export default { this.initData() this.globalObj.apiSource = this.setting.apiSource + this.globalObj.qualityList = music.supportQuality[this.setting.apiSource] this.globalObj.proxy = Object.assign({}, this.setting.network.proxy) window.globalObj = this.globalObj diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index 73af8f76..96ed8512 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -56,7 +56,7 @@ div(:class="$style.player") diff --git a/src/renderer/components/material/DownloadModal.vue b/src/renderer/components/material/DownloadModal.vue index 7ecf9b81..efe021d6 100644 --- a/src/renderer/components/material/DownloadModal.vue +++ b/src/renderer/components/material/DownloadModal.vue @@ -29,6 +29,9 @@ export default { info() { return this.musicInfo || {} }, + qualityList() { + return window.globalObj.qualityList[this.musicInfo.source] + }, }, methods: { handleClick(type) { @@ -51,16 +54,7 @@ export default { } }, checkSource(type) { - switch (this.musicInfo.source) { - case 'wy': - case 'tx': - return type == '128k' - case 'xm': - return type == '128k' || type == '320k' - - default: - return true - } + return this.qualityList.includes(type) }, }, } diff --git a/src/renderer/components/material/SongList.vue b/src/renderer/components/material/SongList.vue index 00c7db6b..4e13f6da 100644 --- a/src/renderer/components/material/SongList.vue +++ b/src/renderer/components/material/SongList.vue @@ -28,9 +28,9 @@ div(:class="$style.songList") td(style="width: 20%; padding-left: 0; padding-right: 0;") material-list-buttons(:index="index" :search-btn="true" :remove-btn="false" @btn-click="handleListBtnClick" - :listAdd-btn="item.source == 'kw' || !isAPITemp" - :play-btn="item.source == 'kw' || !isAPITemp" - :download-btn="item.source == 'kw' || !isAPITemp") + :listAdd-btn="assertApiSupport(item.source)" + :play-btn="assertApiSupport(item.source)" + :download-btn="assertApiSupport(item.source)") //- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载 //- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听 //- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') + @@ -41,12 +41,12 @@ div(:class="$style.songList") transition(enter-active-class="animated-fast fadeIn" leave-active-class="animated-fast fadeOut") div(v-show="!list.length" :class="$style.noitem") p(v-html="noItem") - material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick") + material-flow-btn(:show="isShowEditBtn && assertApiSupport(source)" :remove-btn="false" @btn-click="handleFlowBtnClick") diff --git a/src/renderer/lang/cns/material/download_modal.json b/src/renderer/lang/cns/material/download_modal.json index 3afdbef9..e101440a 100644 --- a/src/renderer/lang/cns/material/download_modal.json +++ b/src/renderer/lang/cns/material/download_modal.json @@ -1,5 +1,5 @@ { - "btn_tip": "腾讯、网易音源仅支持下载128k音质\n虾米音源不支持下载无损音质", + "btn_tip": "该音质不可用", "lossless": "无损音质", "high_quality": "高品音质", "normal": "普通音质" diff --git a/src/renderer/lang/cnt/material/download_modal.json b/src/renderer/lang/cnt/material/download_modal.json index 0931c525..81ad2913 100644 --- a/src/renderer/lang/cnt/material/download_modal.json +++ b/src/renderer/lang/cnt/material/download_modal.json @@ -1,5 +1,5 @@ { - "btn_tip": "騰訊、網易、音源僅支持下載128k音質\n蝦米音源不支持下載無損音質", + "btn_tip": "該音質不可用", "lossless": "無損音質", "high_quality": "高品音質", "normal": "普通音質" diff --git a/src/renderer/lang/en/material/download_modal.json b/src/renderer/lang/en/material/download_modal.json index dbded1ba..141e4ff7 100644 --- a/src/renderer/lang/en/material/download_modal.json +++ b/src/renderer/lang/en/material/download_modal.json @@ -1,5 +1,5 @@ { - "btn_tip": "Tencent and NetEase only support 128k audio quality\nXiami sources does not support 128k audio quality", + "btn_tip": "The audio quality is not available", "lossless": "Lossless", "high_quality": "High Quality", "normal": "Normal" diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index 63c809e0..3caedc92 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -207,6 +207,7 @@ const actions = { } }, createDownloadMultiple({ state, rootState }, { list, type }) { + if (!list.length) return addTask([...list], type, this) }, async startTask({ commit, state, rootState }, downloadInfo) { diff --git a/src/renderer/utils/index.js b/src/renderer/utils/index.js index 4c6f677d..974e75da 100644 --- a/src/renderer/utils/index.js +++ b/src/renderer/utils/index.js @@ -428,3 +428,6 @@ export const setWindowSize = (width, height) => rendererSend('setWindowSize', { export const getProxyInfo = () => window.globalObj.proxy.enable ? `http://${window.globalObj.proxy.username}:${window.globalObj.proxy.password}@${window.globalObj.proxy.host}:${window.globalObj.proxy.port};` : undefined + + +export const assertApiSupport = source => window.globalObj.qualityList[source] != undefined diff --git a/src/renderer/utils/music/api-source.js b/src/renderer/utils/music/api-source.js index 71cc84fb..b93a1e3e 100644 --- a/src/renderer/utils/music/api-source.js +++ b/src/renderer/utils/music/api-source.js @@ -12,7 +12,7 @@ import xm_api_test from './xm/api-test' // import wy_api_internal from './wy/api-internal' // import bd_api_internal from './bd/api-internal' -const apis = { +const apiList = { kw_api_test, tx_api_test, kg_api_test, @@ -32,15 +32,15 @@ const apis = { const getAPI = source => { switch (window.globalObj.apiSource) { // case 'messoer': - // return apis[`${source}_api_messoer`] + // return apiList[`${source}_api_messoer`] case 'test': - return apis[`${source}_api_test`] + return apiList[`${source}_api_test`] case 'temp': - return apis[`${source}_api_temp`] + return apiList[`${source}_api_temp`] } } -export default source => { +export const apis = source => { switch (source) { case 'tx': return getAPI('tx') @@ -58,3 +58,18 @@ export default source => { return getAPI('kw') } } + +export const supportQuality = { + temp: { + kw: ['128k'], + }, + test: { + kw: ['128k'], + kg: ['128k'], + tx: ['128k'], + wy: ['128k'], + mg: ['128k'], + xm: ['128k'], + bd: ['128k'], + }, +} diff --git a/src/renderer/utils/music/bd/index.js b/src/renderer/utils/music/bd/index.js index 2f40dca0..f7cda7b9 100644 --- a/src/renderer/utils/music/bd/index.js +++ b/src/renderer/utils/music/bd/index.js @@ -1,5 +1,5 @@ import leaderboard from './leaderboard' -import api_source from '../api-source' +import { apis } from '../api-source' import musicInfo from './musicInfo' import songList from './songList' import { httpFetch } from '../../request' @@ -12,7 +12,7 @@ const bd = { musicSearch, hotSearch, getMusicUrl(songInfo, type) { - return api_source('bd').getMusicUrl(songInfo, type) + return apis('bd').getMusicUrl(songInfo, type) }, getPic(songInfo) { const requestObj = this.getMusicInfo(songInfo) @@ -25,10 +25,10 @@ const bd = { return requestObj }, // getLyric(songInfo) { - // return api_source('bd').getLyric(songInfo) + // return apis('bd').getLyric(songInfo) // }, // getPic(songInfo) { - // return api_source('bd').getPic(songInfo) + // return apis('bd').getPic(songInfo) // }, getMusicInfo(songInfo) { return musicInfo.getMusicInfo(songInfo.songmid) diff --git a/src/renderer/utils/music/index.js b/src/renderer/utils/music/index.js index e8733624..59ecc964 100644 --- a/src/renderer/utils/music/index.js +++ b/src/renderer/utils/music/index.js @@ -5,6 +5,9 @@ import wy from './wy' import mg from './mg' import bd from './bd' import xm from './xm' +import { supportQuality } from './api-source' + + const sources = { sources: [ { @@ -52,4 +55,5 @@ export default { sm && sm.init && sm.init() } }, + supportQuality, } diff --git a/src/renderer/utils/music/kg/index.js b/src/renderer/utils/music/kg/index.js index 243ee632..ab4f1938 100644 --- a/src/renderer/utils/music/kg/index.js +++ b/src/renderer/utils/music/kg/index.js @@ -1,5 +1,5 @@ import leaderboard from './leaderboard' -import api_source from '../api-source' +import { apis } from '../api-source' import songList from './songList' import musicSearch from './musicSearch' import pic from './pic' @@ -12,19 +12,19 @@ const kg = { musicSearch, hotSearch, getMusicUrl(songInfo, type) { - return api_source('kg').getMusicUrl(songInfo, type) + return apis('kg').getMusicUrl(songInfo, type) }, getLyric(songInfo) { return lyric.getLyric(songInfo) }, // getLyric(songInfo) { - // return api_source('kg').getLyric(songInfo) + // return apis('kg').getLyric(songInfo) // }, getPic(songInfo) { return pic.getPic(songInfo) }, // getPic(songInfo) { - // return api_source('kg').getPic(songInfo) + // return apis('kg').getPic(songInfo) // }, } diff --git a/src/renderer/utils/music/kw/index.js b/src/renderer/utils/music/kw/index.js index 4bd05179..a6321fd0 100644 --- a/src/renderer/utils/music/kw/index.js +++ b/src/renderer/utils/music/kw/index.js @@ -5,7 +5,7 @@ import { formatSinger, getToken } from './util' import leaderboard from './leaderboard' import lyric from './lyric' import pic from './pic' -import api_source from '../api-source' +import { apis } from '../api-source' import songList from './songList' import hotSearch from './hotSearch' @@ -58,7 +58,7 @@ const kw = { }, getMusicUrl(songInfo, type) { - return api_source('kw').getMusicUrl(songInfo, type) + return apis('kw').getMusicUrl(songInfo, type) }, getMusicInfo(songInfo) { diff --git a/src/renderer/utils/music/mg/index.js b/src/renderer/utils/music/mg/index.js index 8cdde2c9..a0099d81 100644 --- a/src/renderer/utils/music/mg/index.js +++ b/src/renderer/utils/music/mg/index.js @@ -1,4 +1,4 @@ -import api_source from '../api-source' +import { apis } from '../api-source' import leaderboard from './leaderboard' import songList from './songList' import musicSearch from './musicSearch' @@ -12,7 +12,7 @@ const mg = { leaderboard, hotSearch, getMusicUrl(songInfo, type) { - return api_source('mg').getMusicUrl(songInfo, type) + return apis('mg').getMusicUrl(songInfo, type) }, getLyric(songInfo) { return lyric.getLyric(songInfo) diff --git a/src/renderer/utils/music/tx/index.js b/src/renderer/utils/music/tx/index.js index db678147..7bdc3e55 100644 --- a/src/renderer/utils/music/tx/index.js +++ b/src/renderer/utils/music/tx/index.js @@ -2,7 +2,7 @@ import leaderboard from './leaderboard' import lyric from './lyric' import songList from './songList' import musicSearch from './musicSearch' -import api_source from '../api-source' +import { apis } from '../api-source' import hotSearch from './hotSearch' const tx = { @@ -12,14 +12,14 @@ const tx = { hotSearch, getMusicUrl(songInfo, type) { - return api_source('tx').getMusicUrl(songInfo, type) + return apis('tx').getMusicUrl(songInfo, type) }, getLyric(songInfo) { // let singer = songInfo.singer.indexOf('、') > -1 ? songInfo.singer.split('、')[0] : songInfo.singer return lyric.getLyric(songInfo.songmid) }, getPic(songInfo) { - return api_source('tx').getPic(songInfo) + return apis('tx').getPic(songInfo) }, } diff --git a/src/renderer/utils/music/utils.js b/src/renderer/utils/music/utils.js index 6bba9104..3427cb3d 100644 --- a/src/renderer/utils/music/utils.js +++ b/src/renderer/utils/music/utils.js @@ -8,14 +8,9 @@ import crypto from 'crypto' const types = ['flac', 'wav', 'ape', '320k', '192k', '128k'] export const getMusicType = (info, type) => { - switch (info.source) { - // case 'kg': - case 'wy': - case 'tx': - return '128k' - case 'xm': - if (type == 'wav') type = '320k' - } + let list = window.globalObj.qualityList[info.source] + if (!list) return '128k' + if (!list.includes(type)) type = list[list.length - 1] const rangeType = types.slice(types.indexOf(type)) for (const type of rangeType) { if (info._types[type]) return type diff --git a/src/renderer/utils/music/wy/index.js b/src/renderer/utils/music/wy/index.js index 4a2f9019..479c2997 100644 --- a/src/renderer/utils/music/wy/index.js +++ b/src/renderer/utils/music/wy/index.js @@ -1,5 +1,5 @@ import leaderboard from './leaderboard' -import api_source from '../api-source' +import { apis } from '../api-source' import getLyric from './lyric' import getMusicInfo from './musicInfo' import musicSearch from './musicSearch' @@ -12,7 +12,7 @@ const wy = { songList, hotSearch, getMusicUrl(songInfo, type) { - return api_source('wy').getMusicUrl(songInfo, type) + return apis('wy').getMusicUrl(songInfo, type) }, getLyric(songInfo) { return getLyric(songInfo.songmid) diff --git a/src/renderer/utils/music/xm/index.js b/src/renderer/utils/music/xm/index.js index 5a3a3ec6..e689c5b7 100644 --- a/src/renderer/utils/music/xm/index.js +++ b/src/renderer/utils/music/xm/index.js @@ -1,4 +1,4 @@ -import api_source from '../api-source' +import { apis } from '../api-source' import leaderboard from './leaderboard' import songList from './songList' import musicSearch from './musicSearch' @@ -14,7 +14,7 @@ const xm = { hotSearch, closeVerifyModal, getMusicUrl(songInfo, type) { - return api_source('xm').getMusicUrl(songInfo, type) + return apis('xm').getMusicUrl(songInfo, type) }, getLyric(songInfo) { return lyric.getLyric(songInfo) diff --git a/src/renderer/views/Leaderboard.vue b/src/renderer/views/Leaderboard.vue index bc6cf52e..3185f3dd 100644 --- a/src/renderer/views/Leaderboard.vue +++ b/src/renderer/views/Leaderboard.vue @@ -34,9 +34,6 @@ export default { types() { return this.source ? this.sourceInfo.sourceList[this.source] : [] }, - isAPITemp() { - return this.setting.apiSource == 'temp' - }, }, watch: { tabId(n, o) { @@ -124,14 +121,7 @@ export default { this.isShowDownload = false }, handleAddDownloadMultiple(type) { - switch (this.source) { - // case 'kg': - case 'tx': - case 'wy': - type = '128k' - case 'xm': - if (type == 'flac') type = 'wav' - } + if (this.source == 'xm' && type == 'flac') type = 'wav' this.createDownloadMultiple({ list: [...this.selectdData], type }) this.isShowDownloadMultiple = false this.resetSelect() diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue index b0e37879..b70b30f1 100644 --- a/src/renderer/views/List.vue +++ b/src/renderer/views/List.vue @@ -16,7 +16,7 @@ table tbody(@contextmenu="handleContextMenu" ref="dom_tbody") tr(v-for='(item, index) in list' :key='item.songmid' :id="'mid_' + item.songmid" - @click="handleDoubleClick($event, index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') ? $style.disabled : '']") + @click="handleDoubleClick($event, index)" :class="[isPlayList && playIndex === index ? $style.active : '', assertApiSupport(item.source) ? null : $style.disabled]") td.nobreak.center(style="width: 37px;" :class="$style.noSelect" @click.stop) {{index + 1}} td.break(style="width: 25%;") span.select {{item.name}} @@ -49,7 +49,7 @@ diff --git a/src/renderer/views/Search.vue b/src/renderer/views/Search.vue index 606ad9a1..354e56e9 100644 --- a/src/renderer/views/Search.vue +++ b/src/renderer/views/Search.vue @@ -30,8 +30,8 @@ span.select {{item.albumName}} td(style="width: 15%; padding-left: 0; padding-right: 0;") material-list-buttons(:index="index" :remove-btn="false" :class="$style.listBtn" - :play-btn="item.source == 'kw' || !isAPITemp" - :download-btn="item.source == 'kw' || !isAPITemp" + :play-btn="assertApiSupport(item.source)" + :download-btn="assertApiSupport(item.source)" @btn-click="handleListBtnClick") td(style="width: 10%;") span(:class="[$style.time, $style.noSelect]") {{item.interval || '--/--'}} @@ -53,14 +53,14 @@ p {{$t('view.search.no_item')}} material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false") material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false") - material-flow-btn(:show="isShowEditBtn && (searchSourceId == 'kw' || searchSourceId == 'all' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick") + material-flow-btn(:show="isShowEditBtn && (searchSourceId == 'all' || assertApiSupport(searchSourceId))" :remove-btn="false" @btn-click="handleFlowBtnClick") material-list-add-modal(:show="isShowListAdd" :musicInfo="musicInfo" @close="isShowListAdd = false") material-list-add-multiple-modal(:show="isShowListAddMultiple" :musicList="selectdData" @close="handleListAddModalClose") diff --git a/src/renderer/views/SongList.vue b/src/renderer/views/SongList.vue index 927b891c..75a265b4 100644 --- a/src/renderer/views/SongList.vue +++ b/src/renderer/views/SongList.vue @@ -60,7 +60,7 @@