修复歌曲ID存储变更导致酷狗图片获取失败的问题

pull/459/head
lyswhut 2021-03-09 17:40:33 +08:00
parent 23dafe539d
commit fa6b7eacaa
5 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "lx-music-desktop", "name": "lx-music-desktop",
"version": "1.8.1", "version": "1.8.2",
"description": "一个免费的音乐查找助手", "description": "一个免费的音乐查找助手",
"main": "./dist/electron/main.js", "main": "./dist/electron/main.js",
"productName": "lx-music-desktop", "productName": "lx-music-desktop",

View File

@ -1,3 +1,3 @@
### 修复 ### 修复
- 修复歌词翻译的主题颜色适配问题 - 修复歌曲ID存储变更导致酷狗图片获取失败的问题

View File

@ -31,9 +31,13 @@ export default {
if (statusCode != 200 || body.err_code !== 0) throw new Error('获取热门评论失败') if (statusCode != 200 || body.err_code !== 0) throw new Error('获取热门评论失败')
return { source: 'kg', comments: this.filterComment(body.weightList || []) } return { source: 'kg', comments: this.filterComment(body.weightList || []) }
}, },
async getReplyComment({ songmid }, replyId, page = 1, limit = 100) { async getReplyComment({ songmid, audioId }, replyId, page = 1, limit = 100) {
if (this._requestObj2) this._requestObj2.cancelHttp() if (this._requestObj2) this._requestObj2.cancelHttp()
songmid = songmid.length == 32 // 修复歌曲ID存储变更导致图片获取失败的问题
? audioId.split('_')[0]
: songmid
const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getReplyWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&kugouid=687373022&appid=1001&childrenid=${songmid}&tid=${replyId}`, { const _requestObj2 = httpFetch(`http://comment.service.kugou.com/index.php?r=commentsv2/getReplyWithLike&code=fc4be23b4e972707f36b8a828a93ba8a&p=${page}&pagesize=${limit}&ver=1.01&clientver=8373&kugouid=687373022&appid=1001&childrenid=${songmid}&tid=${replyId}`, {
headers: { headers: {
'User-Agent': 'Android712-AndroidPhone-8983-18-0-COMMENT-wifi', 'User-Agent': 'Android712-AndroidPhone-8983-18-0-COMMENT-wifi',

View File

@ -48,7 +48,7 @@ export default {
name: decodeName(rawData.songname), name: decodeName(rawData.songname),
albumName: decodeName(rawData.album_name), albumName: decodeName(rawData.album_name),
albumId: rawData.album_id, albumId: rawData.album_id,
songmid: rawData.hash, songmid: rawData.audio_id,
source: 'kg', source: 'kg',
interval: formatPlayTime(rawData.duration), interval: formatPlayTime(rawData.duration),
_interval: rawData.duration, _interval: rawData.duration,
@ -58,7 +58,6 @@ export default {
hash: rawData.hash, hash: rawData.hash,
types, types,
_types, _types,
audioId: rawData.audio_id + '_' + rawData.hash,
typeUrl: {}, typeUrl: {},
} }
}, },

View File

@ -20,7 +20,10 @@ export default {
relate: 1, relate: 1,
resource: [ resource: [
{ {
album_audio_id: songInfo.songmid, album_audio_id:
songInfo.songmid.length == 32 // 修复歌曲ID存储变更导致图片获取失败的问题
? songInfo.audioId.split('_')[0]
: songInfo.songmid,
album_id: songInfo.albumId, album_id: songInfo.albumId,
hash: songInfo.hash, hash: songInfo.hash,
id: 0, id: 0,