更新依赖
This commit is contained in:
@@ -377,11 +377,13 @@ const actions = {
|
||||
},
|
||||
}
|
||||
commit('setStatusText', { downloadInfo, text: '获取URL中...' })
|
||||
let p = options.url ? Promise.resolve() : getUrl(downloadInfo).then(result => {
|
||||
commit('updateUrl', { downloadInfo, url: result.url })
|
||||
if (!result.url) return Promise.reject(new Error('获取URL失败'))
|
||||
options.url = result.url
|
||||
})
|
||||
let p = options.url
|
||||
? Promise.resolve()
|
||||
: getUrl(downloadInfo).then(result => {
|
||||
commit('updateUrl', { downloadInfo, url: result.url })
|
||||
if (!result.url) return Promise.reject(new Error('获取URL失败'))
|
||||
options.url = result.url
|
||||
})
|
||||
p.then(() => {
|
||||
tryNum[downloadInfo.key] = 0
|
||||
dls[downloadInfo.key] = download(options)
|
||||
|
||||
@@ -85,10 +85,12 @@ const actions = {
|
||||
let source = rootState.setting.songList.source
|
||||
const loadData = (id, page) => {
|
||||
let key = `sdetail__${source}__${id}__${page}`
|
||||
return cache.has(key) ? Promise.resolve(cache.get(key)) : music[source].songList.getListDetail(id, page).then(result => {
|
||||
cache.set(key, result)
|
||||
return result
|
||||
})
|
||||
return cache.has(key)
|
||||
? Promise.resolve(cache.get(key))
|
||||
: music[source].songList.getListDetail(id, page).then(result => {
|
||||
cache.set(key, result)
|
||||
return result
|
||||
})
|
||||
}
|
||||
return loadData(id, 1).then(result => {
|
||||
if (result.total <= result.limit) return result.list
|
||||
|
||||
@@ -132,7 +132,7 @@ const handleScroll = (element, to, duration = 300, fn = () => {}) => {
|
||||
* @param {*} fn 滚动完成后的回调
|
||||
* @param {*} delay 延迟执行时间
|
||||
*/
|
||||
export const scrollTo = (element, to, duration = 300, fn = () => {}, delay) => {
|
||||
export const scrollTo = (element, to, duration = 300, fn = () => {}, delay = 0) => {
|
||||
let cancelFn
|
||||
let timeout
|
||||
if (delay) {
|
||||
|
||||
@@ -382,7 +382,8 @@ export default {
|
||||
return this.searchSourceId == 'all'
|
||||
? list.filter(s => this.assertApiSupport(s.source))
|
||||
: this.assertApiSupport(this.searchSourceId)
|
||||
? [...list] : []
|
||||
? [...list]
|
||||
: []
|
||||
},
|
||||
handleListAddModalClose() {
|
||||
this.isShowListAdd = false
|
||||
|
||||
Reference in New Issue
Block a user