feat(api): 新增歌手与专辑接口,修复各平台死代码中的多处隐藏 bug

This commit is contained in:
snowy-yang committed 2026-09-16 22:23:22 +08:00
1 parent d142dd6096
commit 23c7ad91e4
14 files changed
+317 -115

No files matched your search

+7 -9
View File
@@ -29,23 +29,21 @@ export default {
play_count: listInfo.play_count,
},
}
},
/**
}, /**
* 通过AlbumId获取专辑信息
* @param {*} id
* @param {*} page
*/
async getAlbumInfo(id) {
const info = await createHttpFetch(`https://app.c.nf.migu.cn/MIGUM3.0/resource/album/v2.0?albumId=${id}`)
if (!info) return Promise.reject(new Error('Get album info error.'))
return {
name: info.title,
image: info.imgItems.length ? info.imgItems[0].img : null,
desc: info.summary,
author: info.singer,
play_count: formatPlayCount(info.opNumItem.playNum),
total: info.totalCount,
name: info.title ?? null,
image: info.imgItems?.length ? info.imgItems[0].img : null,
desc: info.summary ?? null,
author: info.singer ?? null,
play_count: formatPlayCount(info.opNumItem?.playNum ?? 0),
total: parseInt(info.totalCount) || null,
}
},
}
+2
View File
@@ -6,6 +6,7 @@ import pic from './pic.ts'
import lyric from './lyric.ts'
import hotSearch from './hotSearch.ts'
import comment from './comment.ts'
import album from './album.js'
// import tipSearch from './tipSearch.ts'
const mg = {
@@ -15,6 +16,7 @@ const mg = {
leaderboard,
hotSearch,
comment,
album,
getMusicUrl(songInfo, type) {
return apis('mg').getMusicUrl!(songInfo, type)
},