更新已收藏的在线列表时,将始终重新加载,不再使用缓存
parent
bad2e98757
commit
30d5f53c1d
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
- 为可视化音频的频谱整体添加频谱均值加成,使频谱显示更有节奏感
|
- 为可视化音频的频谱整体添加频谱均值加成,使频谱显示更有节奏感
|
||||||
- 优化程序初始化逻辑,修复无网络的情况下的初始化问题
|
- 优化程序初始化逻辑,修复无网络的情况下的初始化问题
|
||||||
|
- 我的列表-列表名的右击菜单更新已收藏的在线列表时,将始终重新加载,不再使用缓存,解决在原平台更新歌单后,在LX点击更新可能看到的还是在原平台更新前的歌单的问题
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,12 @@ const actions = {
|
||||||
return listInfo
|
return listInfo
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getListAll({ state, rootState }, id) {
|
getListAll({ state, rootState }, { id, isRefresh = false }) {
|
||||||
// console.log(source, id)
|
// console.log(source, id)
|
||||||
let [source, bangId] = id.split('__')
|
let [source, bangId] = id.split('__')
|
||||||
const loadData = (id, page) => {
|
const loadData = (id, page) => {
|
||||||
let key = `${source}${id}${page}`
|
let key = `${source}${id}${page}`
|
||||||
|
if (isRefresh && cache.has(key)) cache.delete(key)
|
||||||
return cache.has(key)
|
return cache.has(key)
|
||||||
? Promise.resolve(cache.get(key))
|
? Promise.resolve(cache.get(key))
|
||||||
: music[source].leaderboard.getList(bangId, page).then(result => {
|
: music[source].leaderboard.getList(bangId, page).then(result => {
|
||||||
|
|
|
@ -81,10 +81,11 @@ const actions = {
|
||||||
commit('clearList')
|
commit('clearList')
|
||||||
return music[source].songList.getList(sortId, tabId, page).then(result => commit('setList', { result, key, page }))
|
return music[source].songList.getList(sortId, tabId, page).then(result => commit('setList', { result, key, page }))
|
||||||
},
|
},
|
||||||
getListDetail({ state, commit }, { id, source, page }) {
|
getListDetail({ state, commit }, { id, source, page, isRefresh = false }) {
|
||||||
let key = `sdetail__${source}__${id}__${page}`
|
let key = `sdetail__${source}__${id}__${page}`
|
||||||
if (state.listDetail.list.length && state.listDetail.key == key) return Promise.resolve(state.listDetail.list)
|
if (state.listDetail.list.length && state.listDetail.key == key) return Promise.resolve(state.listDetail.list)
|
||||||
commit('clearListDetail')
|
commit('clearListDetail')
|
||||||
|
if (isRefresh && cache.has(key)) cache.delete(key)
|
||||||
return (
|
return (
|
||||||
cache.has(key)
|
cache.has(key)
|
||||||
? Promise.resolve(cache.get(key))
|
? Promise.resolve(cache.get(key))
|
||||||
|
@ -94,10 +95,11 @@ const actions = {
|
||||||
return result.list
|
return result.list
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getListDetailAll({ state, rootState }, { source, id }) {
|
getListDetailAll({ state, rootState }, { source, id, isRefresh = false }) {
|
||||||
// console.log(source, id)
|
// console.log(source, id)
|
||||||
const loadData = (id, page) => {
|
const loadData = (id, page) => {
|
||||||
let key = `sdetail__${source}__${id}__${page}`
|
let key = `sdetail__${source}__${id}__${page}`
|
||||||
|
if (isRefresh && cache.has(key)) cache.delete(key)
|
||||||
return cache.has(key)
|
return cache.has(key)
|
||||||
? Promise.resolve(cache.get(key))
|
? Promise.resolve(cache.get(key))
|
||||||
: music[source].songList.getListDetail(id, page).then(result => {
|
: music[source].songList.getListDetail(id, page).then(result => {
|
||||||
|
|
|
@ -211,7 +211,7 @@ export default {
|
||||||
async addSongListDetail({ boardId, boardName, source, id }) {
|
async addSongListDetail({ boardId, boardName, source, id }) {
|
||||||
// console.log(this.listDetail.info)
|
// console.log(this.listDetail.info)
|
||||||
// if (!this.listDetail.info.name) return
|
// if (!this.listDetail.info.name) return
|
||||||
const list = await this.getListAll(boardId)
|
const list = await this.getListAll({ id: boardId })
|
||||||
this.createUserList({
|
this.createUserList({
|
||||||
name: boardName,
|
name: boardName,
|
||||||
id,
|
id,
|
||||||
|
@ -230,7 +230,7 @@ export default {
|
||||||
})
|
})
|
||||||
isPlayingList = true
|
isPlayingList = true
|
||||||
}
|
}
|
||||||
const fullList = await this.getListAll(boardId)
|
const fullList = await this.getListAll({ id: boardId })
|
||||||
if (!fullList.length) return
|
if (!fullList.length) return
|
||||||
if (isPlayingList) {
|
if (isPlayingList) {
|
||||||
if (tempList.meta.id == id) {
|
if (tempList.meta.id == id) {
|
||||||
|
|
|
@ -339,9 +339,9 @@ export default {
|
||||||
let promise
|
let promise
|
||||||
if (/board__/.test(sourceListId)) {
|
if (/board__/.test(sourceListId)) {
|
||||||
const id = sourceListId.replace(/board__/, '')
|
const id = sourceListId.replace(/board__/, '')
|
||||||
promise = this.getBoardListAll(id)
|
promise = this.getBoardListAll({ id, isRefresh: true })
|
||||||
} else {
|
} else {
|
||||||
promise = this.getListDetailAll({ source, id: sourceListId })
|
promise = this.getListDetailAll({ source, id: sourceListId, isRefresh: true })
|
||||||
}
|
}
|
||||||
return promise.finally(() => {
|
return promise.finally(() => {
|
||||||
this.fetchingListStatus[id] = false
|
this.fetchingListStatus[id] = false
|
||||||
|
|
Loading…
Reference in New Issue