容旧版酷我源搜索列表过滤128k音质的bug
parent
5c32160a58
commit
0a5e7c44ff
|
@ -1,3 +1,3 @@
|
||||||
#### 修复
|
#### 修复
|
||||||
|
|
||||||
- 修复酷我源搜索歌曲结果未添加128k音质导致播放128k音质时显示“该歌曲没有可播放的音频”的问题
|
- 兼容旧版酷我源搜索列表过滤128k音质的bug(注:0.8.1版本仅修复了酷我源的歌曲过滤问题,该修复仅对以后添加的歌曲有效,如果是之前添加的歌曲仍会出现这个问题,现修复对之前旧列表数据的兼容处理)
|
||||||
|
|
|
@ -75,7 +75,12 @@ const addTask = (list, type, store) => {
|
||||||
|
|
||||||
const getUrl = (downloadInfo, isRefresh) => {
|
const getUrl = (downloadInfo, isRefresh) => {
|
||||||
const url = downloadInfo.musicInfo.typeUrl[downloadInfo.type]
|
const url = downloadInfo.musicInfo.typeUrl[downloadInfo.type]
|
||||||
if (!downloadInfo.musicInfo._types[downloadInfo.type]) return Promise.reject(new Error('该歌曲没有可下载的音频'))
|
if (!downloadInfo.musicInfo._types[downloadInfo.type]) {
|
||||||
|
// 兼容旧版酷我源搜索列表过滤128k音质的bug
|
||||||
|
if (!(downloadInfo.musicInfo.source == 'kw' && downloadInfo.type == '128k')) return Promise.reject(new Error('该歌曲没有可下载的音频'))
|
||||||
|
|
||||||
|
// return Promise.reject(new Error('该歌曲没有可下载的音频'))
|
||||||
|
}
|
||||||
return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,12 @@ const getters = {
|
||||||
// actions
|
// actions
|
||||||
const actions = {
|
const actions = {
|
||||||
getUrl({ commit, state }, { musicInfo, type, isRefresh }) {
|
getUrl({ commit, state }, { musicInfo, type, isRefresh }) {
|
||||||
if (!musicInfo._types[type]) return Promise.reject(new Error('该歌曲没有可播放的音频'))
|
if (!musicInfo._types[type]) {
|
||||||
|
// 兼容旧版酷我源搜索列表过滤128k音质的bug
|
||||||
|
if (!(musicInfo.source == 'kw' && type == '128k')) return Promise.reject(new Error('该歌曲没有可播放的音频'))
|
||||||
|
|
||||||
|
// return Promise.reject(new Error('该歌曲没有可播放的音频'))
|
||||||
|
}
|
||||||
if (urlRequest && urlRequest.cancelHttp) urlRequest.cancelHttp()
|
if (urlRequest && urlRequest.cancelHttp) urlRequest.cancelHttp()
|
||||||
if (musicInfo.typeUrl[type] && !isRefresh) return Promise.resolve()
|
if (musicInfo.typeUrl[type] && !isRefresh) return Promise.resolve()
|
||||||
urlRequest = music[musicInfo.source].getMusicUrl(musicInfo, type)
|
urlRequest = music[musicInfo.source].getMusicUrl(musicInfo, type)
|
||||||
|
|
Loading…
Reference in New Issue