From 777551cb43163e658c8eb12019ddee1b6aa4959b Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 11 Feb 2022 16:51:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E5=BC=80=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E7=9A=84=E5=9C=A8=E7=BA=BF=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=B9=B3=E5=8F=B0=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/lang/en-us.json | 1 + src/lang/zh-cn.json | 1 + src/lang/zh-tw.json | 1 + src/renderer/store/modules/songList.js | 8 ++-- src/renderer/utils/music/kg/leaderboard.js | 4 ++ src/renderer/utils/music/kg/songList.js | 5 +++ src/renderer/utils/music/kw/leaderboard.js | 4 ++ src/renderer/utils/music/kw/songList.js | 7 ++++ src/renderer/utils/music/mg/leaderboard.js | 13 +++++- src/renderer/utils/music/mg/songList.js | 4 ++ src/renderer/utils/music/tx/leaderboard.js | 5 +++ src/renderer/utils/music/tx/songList.js | 4 ++ src/renderer/utils/music/wy/leaderboard.js | 5 +++ src/renderer/utils/music/wy/songList.js | 4 ++ .../views/list/components/MyLists.vue | 41 ++++++++++++++++++- 16 files changed, 100 insertions(+), 8 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 26fd1a39..a6b56050 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -2,6 +2,7 @@ - 过滤tx源某些不支持播放的歌曲,解决播放此类内容会导致意外的问题 - 新增“双击列表里的歌曲时自动切换到当前列表播放”设置,此功能仅对歌单、排行榜有效,默认关闭 +- 新增打开收藏的在线列表的对应平台详情页功能,可以在我的列表-列表右键菜单中使用 ### 修复 diff --git a/src/lang/en-us.json b/src/lang/en-us.json index cd171e66..875eb1db 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -118,6 +118,7 @@ "lists__remove_tip_button": "Yes, that's right", "lists__rename": "Rename", "lists__sort_list": "Sort songs", + "lists__source_detail": "Playlist Page", "lists__sync": "Update", "load_list_file_error_detail": "We have helped you back up the old list file to {path}\nIt is stored in JSON format, you can try to repair and restore it manually\n\nError details: {detail}", "load_list_file_error_title": "Error loading playlist data", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index de13f05a..0e3b4abd 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -118,6 +118,7 @@ "lists__remove_tip_button": "是的 没错", "lists__rename": "重命名", "lists__sort_list": "排序歌曲", + "lists__source_detail": "歌单详情页", "lists__sync": "更新", "load_list_file_error_detail": "我们已经帮你把旧的列表文件备份到{path}\n它以 JSON 格式存储,你可以尝试手动修复并恢复它\n\n错误详情:{detail}", "load_list_file_error_title": "播放列表数据加载错误(建议到GitHub或加群反馈)", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 6bbd1c33..4aedd277 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -118,6 +118,7 @@ "lists__remove_tip_button": "是的 沒錯", "lists__rename": "重命名", "lists__sort_list": "排序歌曲", + "lists__source_detail": "歌單詳情頁", "lists__sync": "更新", "load_list_file_error_detail": "我們已經幫你把舊的列表文件備份到{path}\n它以 JSON 格式存儲,你可以嘗試手動修復並恢復它\n\n錯誤詳情:{detail}", "load_list_file_error_title": "播放列表數據加載錯誤", diff --git a/src/renderer/store/modules/songList.js b/src/renderer/store/modules/songList.js index d2b2d14a..c784fd86 100644 --- a/src/renderer/store/modules/songList.js +++ b/src/renderer/store/modules/songList.js @@ -68,7 +68,7 @@ const getters = { const actions = { getTags({ state, rootState, commit }) { let source = rootState.setting.songList.source - return music[source].songList.getTags().then(result => commit('setTags', { tags: result, source })) + return music[source]?.songList.getTags().then(result => commit('setTags', { tags: result, source })) }, getList({ state, rootState, commit }, page) { let source = rootState.setting.songList.source @@ -79,7 +79,7 @@ const actions = { if (state.list.list.length && state.list.key == key) return if (cache.has(key)) return Promise.resolve(cache.get(key)).then(result => commit('setList', { result, key, page })) commit('clearList') - return music[source].songList.getList(sortId, tabId, page).then(result => commit('setList', { result, key, page })) + return music[source]?.songList.getList(sortId, tabId, page).then(result => commit('setList', { result, key, page })) }, getListDetail({ state, commit }, { id, source, page, isRefresh = false }) { let key = `sdetail__${source}__${id}__${page}` @@ -89,7 +89,7 @@ const actions = { return ( cache.has(key) ? Promise.resolve(cache.get(key)) - : music[source].songList.getListDetail(id, page).then(result => ({ ...result, list: filterList(result.list) })) + : music[source]?.songList.getListDetail(id, page).then(result => ({ ...result, list: filterList(result.list) })) ).then(result => { commit('setListDetail', { result, key, source, id, page }) return result.list @@ -102,7 +102,7 @@ const actions = { if (isRefresh && cache.has(key)) cache.delete(key) return cache.has(key) ? Promise.resolve(cache.get(key)) - : music[source].songList.getListDetail(id, page).then(result => { + : music[source]?.songList.getListDetail(id, page).then(result => { cache.set(key, result) return result }) diff --git a/src/renderer/utils/music/kg/leaderboard.js b/src/renderer/utils/music/kg/leaderboard.js index eb8c9c11..b26e65e0 100644 --- a/src/renderer/utils/music/kg/leaderboard.js +++ b/src/renderer/utils/music/kg/leaderboard.js @@ -193,4 +193,8 @@ export default { } }) }, + getDetailPageUrl(id) { + if (typeof id == 'string') id = id.replace('kg__', '') + return `https://www.kugou.com/yy/rank/home/1-${id}.html` + }, } diff --git a/src/renderer/utils/music/kg/songList.js b/src/renderer/utils/music/kg/songList.js index 825e4527..f4c008b4 100644 --- a/src/renderer/utils/music/kg/songList.js +++ b/src/renderer/utils/music/kg/songList.js @@ -718,6 +718,11 @@ export default { } }) }, + + getDetailPageUrl(id) { + if (typeof id == 'string') id = id.replace('id_', '') + return `https://www.kugou.com/yy/special/single/${id}.html` + }, } // getList diff --git a/src/renderer/utils/music/kw/leaderboard.js b/src/renderer/utils/music/kw/leaderboard.js index b731e633..d978780a 100644 --- a/src/renderer/utils/music/kw/leaderboard.js +++ b/src/renderer/utils/music/kw/leaderboard.js @@ -191,4 +191,8 @@ export default { } }) }, + + // getDetailPageUrl(id) { + // return `http://www.kuwo.cn/rankList/${id}` + // }, } diff --git a/src/renderer/utils/music/kw/songList.js b/src/renderer/utils/music/kw/songList.js index 36ed6ea3..e15e0cd4 100644 --- a/src/renderer/utils/music/kw/songList.js +++ b/src/renderer/utils/music/kw/songList.js @@ -307,6 +307,13 @@ export default { getTags() { return Promise.all([this.getTag(), this.getHotTag()]).then(([tags, hotTag]) => ({ tags, hotTag, source: 'kw' })) }, + getDetailPageUrl(id) { + if (/^digest-/.test(id)) { + let result = id.split('__') + id = result[1] + } + return `http://www.kuwo.cn/playlist_detail/${id}` + }, } // getList diff --git a/src/renderer/utils/music/mg/leaderboard.js b/src/renderer/utils/music/mg/leaderboard.js index 8e67ea5a..bac7bf33 100644 --- a/src/renderer/utils/music/mg/leaderboard.js +++ b/src/renderer/utils/music/mg/leaderboard.js @@ -4,8 +4,7 @@ import { sizeFormate } from '../../index' // const boardList = [{ id: 'mg__27553319', name: '咪咕尖叫新歌榜', bangid: '27553319' }, { id: 'mg__27186466', name: '咪咕尖叫热歌榜', bangid: '27186466' }, { id: 'mg__27553408', name: '咪咕尖叫原创榜', bangid: '27553408' }, { id: 'mg__23189800', name: '咪咕港台榜', bangid: '23189800' }, { id: 'mg__23189399', name: '咪咕内地榜', bangid: '23189399' }, { id: 'mg__19190036', name: '咪咕欧美榜', bangid: '19190036' }, { id: 'mg__23189813', name: '咪咕日韩榜', bangid: '23189813' }, { id: 'mg__23190126', name: '咪咕彩铃榜', bangid: '23190126' }, { id: 'mg__15140045', name: '咪咕KTV榜', bangid: '15140045' }, { id: 'mg__15140034', name: '咪咕网络榜', bangid: '15140034' }, { id: 'mg__23217754', name: 'MV榜', bangid: '23217754' }, { id: 'mg__23218151', name: '新专辑榜', bangid: '23218151' }, { id: 'mg__21958042', name: 'iTunes榜', bangid: '21958042' }, { id: 'mg__21975570', name: 'billboard榜', bangid: '21975570' }, { id: 'mg__22272815', name: '台湾Hito中文榜', bangid: '22272815' }, { id: 'mg__22272904', name: '中国TOP排行榜', bangid: '22272904' }, { id: 'mg__22272943', name: '韩国Melon榜', bangid: '22272943' }, { id: 'mg__22273437', name: '英国UK榜', bangid: '22273437' }] -const boardList = [{ id: 'mg__27553319', name: '尖叫新歌榜', bangid: '27553319' }, { id: 'mg__27186466', name: '尖叫热歌榜', bangid: '27186466' }, { id: 'mg__27553408', name: '尖叫原创榜', bangid: '27553408' }, { id: 'mg__23189800', name: '港台榜', bangid: '23189800' }, { id: 'mg__23189399', name: '内地榜', bangid: '23189399' }, { id: 'mg__19190036', name: '欧美榜', bangid: '19190036' }, { id: 'mg__23189813', name: '日韩榜', bangid: '23189813' }, { id: 'mg__23190126', name: '彩铃榜', bangid: '23190126' }, { id: 'mg__15140045', name: 'KTV榜', bangid: '15140045' }, { id: 'mg__15140034', name: '网络榜', bangid: '15140034' }, { id: 'mg__21958042', name: '美国iTunes榜', bangid: '21958042' }, { id: 'mg__21975570', name: '美国billboard榜', bangid: '21975570' }, { id: 'mg__22272815', name: '台湾Hito中文榜', bangid: '22272815' }, { id: 'mg__22272943', name: '韩国Melon榜', bangid: '22272943' }, { id: 'mg__22273437', name: '英国UK榜', bangid: '22273437' }] - +const boardList = [{ id: 'mg__27553319', name: '尖叫新歌榜', bangid: '27553319', webId: 'jianjiao_newsong' }, { id: 'mg__27186466', name: '尖叫热歌榜', bangid: '27186466', webId: 'jianjiao_hotsong' }, { id: 'mg__27553408', name: '尖叫原创榜', bangid: '27553408', webId: 'jianjiao_original' }, { id: 'mg__23189800', name: '港台榜', bangid: '23189800', webId: 'hktw' }, { id: 'mg__23189399', name: '内地榜', bangid: '23189399', webId: 'mainland' }, { id: 'mg__19190036', name: '欧美榜', bangid: '19190036', webId: 'eur_usa' }, { id: 'mg__23189813', name: '日韩榜', bangid: '23189813', webId: 'jpn_kor' }, { id: 'mg__23190126', name: '彩铃榜', bangid: '23190126', webId: 'coloring' }, { id: 'mg__15140045', name: 'KTV榜', bangid: '15140045', webId: 'ktv' }, { id: 'mg__15140034', name: '网络榜', bangid: '15140034', webId: 'network' }, { id: 'mg__21958042', name: '美国iTunes榜', bangid: '21958042', webId: 'itunes' }, { id: 'mg__21975570', name: '美国billboard榜', bangid: '21975570', webId: 'billboard' }, { id: 'mg__22272815', name: '台湾Hito中文榜', bangid: '22272815', webId: 'hito' }, { id: 'mg__22272943', name: '韩国Melon榜', bangid: '22272943', webId: 'mnet' }, { id: 'mg__22273437', name: '英国UK榜', bangid: '22273437', webId: 'uk' }] export default { limit: 200, list: [ @@ -216,4 +215,14 @@ export default { } }) }, + + getDetailPageUrl(id) { + if (typeof id == 'string') id = id.replace('mg__', '') + for (const item of boardList) { + if (item.bangid == id) { + return `https://music.migu.cn/v3/music/top/${item.webId}` + } + } + return null + }, } diff --git a/src/renderer/utils/music/mg/songList.js b/src/renderer/utils/music/mg/songList.js index f6e42c70..72ac1d09 100644 --- a/src/renderer/utils/music/mg/songList.js +++ b/src/renderer/utils/music/mg/songList.js @@ -355,6 +355,10 @@ export default { getTags() { return this.getTag() }, + + getDetailPageUrl(id) { + return `https://music.migu.cn/v3/music/playlist/${id}` + }, } // getList diff --git a/src/renderer/utils/music/tx/leaderboard.js b/src/renderer/utils/music/tx/leaderboard.js index 89d9eb5f..63330b84 100644 --- a/src/renderer/utils/music/tx/leaderboard.js +++ b/src/renderer/utils/music/tx/leaderboard.js @@ -237,4 +237,9 @@ export default { }) }) }, + + getDetailPageUrl(id) { + if (typeof id == 'string') id = id.replace('tx__', '') + return `https://y.qq.com/n/ryqq/toplist/${id}` + }, } diff --git a/src/renderer/utils/music/tx/songList.js b/src/renderer/utils/music/tx/songList.js index 79f06e4b..abebf341 100644 --- a/src/renderer/utils/music/tx/songList.js +++ b/src/renderer/utils/music/tx/songList.js @@ -292,6 +292,10 @@ export default { getTags() { return Promise.all([this.getTag(), this.getHotTag()]).then(([tags, hotTag]) => ({ tags, hotTag, source: 'tx' })) }, + + getDetailPageUrl(id) { + return `https://y.qq.com/n/ryqq/playlist/${id}` + }, } // getList diff --git a/src/renderer/utils/music/wy/leaderboard.js b/src/renderer/utils/music/wy/leaderboard.js index dd6aa60d..1427da31 100644 --- a/src/renderer/utils/music/wy/leaderboard.js +++ b/src/renderer/utils/music/wy/leaderboard.js @@ -199,4 +199,9 @@ export default { source: 'wy', } }, + + getDetailPageUrl(id) { + if (typeof id == 'string') id = id.replace('wy__', '') + return `https://music.163.com/#/discover/toplist?id=${id}` + }, } diff --git a/src/renderer/utils/music/wy/songList.js b/src/renderer/utils/music/wy/songList.js index 857039ef..b8b3c051 100644 --- a/src/renderer/utils/music/wy/songList.js +++ b/src/renderer/utils/music/wy/songList.js @@ -289,6 +289,10 @@ export default { getTags() { return Promise.all([this.getTag(), this.getHotTag()]).then(([tags, hotTag]) => ({ tags, hotTag, source: 'wy' })) }, + + getDetailPageUrl(id) { + return `https://music.163.com/#/playlist?id=${id}` + }, } // getList diff --git a/src/renderer/views/list/components/MyLists.vue b/src/renderer/views/list/components/MyLists.vue index c7db1752..733ec502 100644 --- a/src/renderer/views/list/components/MyLists.vue +++ b/src/renderer/views/list/components/MyLists.vue @@ -19,7 +19,7 @@ {{loveList.name}}
  • {{item.name}} @@ -41,7 +41,7 @@