修复wy源我喜欢个人云盘歌曲信息获取问题
parent
ae467cd515
commit
e467b92bb9
|
@ -6,7 +6,7 @@ import { formatPlayTime, sizeFormate } from '../../index'
|
||||||
export default {
|
export default {
|
||||||
getSinger(singers) {
|
getSinger(singers) {
|
||||||
let arr = []
|
let arr = []
|
||||||
singers.forEach(singer => {
|
singers?.forEach(singer => {
|
||||||
arr.push(singer.name)
|
arr.push(singer.name)
|
||||||
})
|
})
|
||||||
return arr.join('、')
|
return arr.join('、')
|
||||||
|
@ -46,21 +46,39 @@ export default {
|
||||||
|
|
||||||
types.reverse()
|
types.reverse()
|
||||||
|
|
||||||
|
if (item.pc) {
|
||||||
list.push({
|
list.push({
|
||||||
singer: this.getSinger(item.ar),
|
singer: item.pc.ar,
|
||||||
name: item.name,
|
name: item.pc.sn,
|
||||||
albumName: item.al.name,
|
albumName: item.pc.alb,
|
||||||
albumId: item.al.id,
|
albumId: item.al?.id,
|
||||||
source: 'wy',
|
source: 'wy',
|
||||||
interval: formatPlayTime(item.dt / 1000),
|
interval: formatPlayTime(item.dt / 1000),
|
||||||
songmid: item.id,
|
songmid: item.id,
|
||||||
img: item.al.picUrl,
|
img: item.al?.picUrl ?? '',
|
||||||
lrc: null,
|
lrc: null,
|
||||||
otherSource: null,
|
otherSource: null,
|
||||||
types,
|
types,
|
||||||
_types,
|
_types,
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
list.push({
|
||||||
|
singer: this.getSinger(item.ar),
|
||||||
|
name: item.name,
|
||||||
|
albumName: item.al?.name,
|
||||||
|
albumId: item.al?.id,
|
||||||
|
source: 'wy',
|
||||||
|
interval: formatPlayTime(item.dt / 1000),
|
||||||
|
songmid: item.id,
|
||||||
|
img: item.al?.picUrl,
|
||||||
|
lrc: null,
|
||||||
|
otherSource: null,
|
||||||
|
types,
|
||||||
|
_types,
|
||||||
|
typeUrl: {},
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// console.log(list)
|
// console.log(list)
|
||||||
return list
|
return list
|
||||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
||||||
},
|
},
|
||||||
getSinger(singers) {
|
getSinger(singers) {
|
||||||
let arr = []
|
let arr = []
|
||||||
singers.forEach(singer => {
|
singers?.forEach(singer => {
|
||||||
arr.push(singer.name)
|
arr.push(singer.name)
|
||||||
})
|
})
|
||||||
return arr.join('、')
|
return arr.join('、')
|
||||||
|
@ -107,9 +107,12 @@ export default {
|
||||||
let limit = 1000
|
let limit = 1000
|
||||||
let rangeStart = (page - 1) * limit
|
let rangeStart = (page - 1) * limit
|
||||||
// console.log(body)
|
// console.log(body)
|
||||||
let musicDetail
|
let list
|
||||||
|
if (body.playlist.trackIds.length == body.privileges.length) {
|
||||||
|
list = this.filterListDetail(body)
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
musicDetail = await musicDetailApi.getList(body.playlist.trackIds.slice(rangeStart, limit * page).map(trackId => trackId.id))
|
list = (await musicDetailApi.getList(body.playlist.trackIds.slice(rangeStart, limit * page).map(trackId => trackId.id))).list
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
if (err.message == 'try max num') {
|
if (err.message == 'try max num') {
|
||||||
|
@ -118,9 +121,10 @@ export default {
|
||||||
return this.getListDetail(id, page, ++tryNum)
|
return this.getListDetail(id, page, ++tryNum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(musicDetail)
|
}
|
||||||
|
// console.log(list)
|
||||||
return {
|
return {
|
||||||
list: musicDetail.list,
|
list,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit,
|
||||||
total: body.playlist.trackIds.length,
|
total: body.playlist.trackIds.length,
|
||||||
|
@ -169,21 +173,39 @@ export default {
|
||||||
|
|
||||||
types.reverse()
|
types.reverse()
|
||||||
|
|
||||||
|
if (item.pc) {
|
||||||
list.push({
|
list.push({
|
||||||
singer: this.getSinger(item.ar),
|
singer: item.pc.ar,
|
||||||
name: item.name,
|
name: item.pc.sn,
|
||||||
albumName: item.al.name,
|
albumName: item.pc.alb,
|
||||||
albumId: item.al.id,
|
albumId: item.al?.id,
|
||||||
source: 'wy',
|
source: 'wy',
|
||||||
interval: formatPlayTime(item.dt / 1000),
|
interval: formatPlayTime(item.dt / 1000),
|
||||||
songmid: item.id,
|
songmid: item.id,
|
||||||
img: item.al.picUrl,
|
img: item.al?.picUrl ?? '',
|
||||||
lrc: null,
|
lrc: null,
|
||||||
otherSource: null,
|
otherSource: null,
|
||||||
types,
|
types,
|
||||||
_types,
|
_types,
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
list.push({
|
||||||
|
singer: this.getSinger(item.ar),
|
||||||
|
name: item.name,
|
||||||
|
albumName: item.al?.name,
|
||||||
|
albumId: item.al?.id,
|
||||||
|
source: 'wy',
|
||||||
|
interval: formatPlayTime(item.dt / 1000),
|
||||||
|
songmid: item.id,
|
||||||
|
img: item.al?.picUrl,
|
||||||
|
lrc: null,
|
||||||
|
otherSource: null,
|
||||||
|
types,
|
||||||
|
_types,
|
||||||
|
typeUrl: {},
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return list
|
return list
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue