新增播放进度信息保存

This commit is contained in:
lyswhut
2020-11-19 15:52:00 +08:00
parent b3e3860b23
commit 64a53830e4
3 changed files with 57 additions and 10 deletions
+25
View File
@@ -174,6 +174,9 @@ export default {
...mapMutations('search', {
setSearchHistoryList: 'setHistory',
}),
...mapMutations('player', {
setPlayList: 'setList',
}),
init() {
document.documentElement.style.fontSize = this.windowSizeActive.fontSize
@@ -276,6 +279,7 @@ export default {
if (!loveList.list) loveList.list = []
this.initList({ defaultList, loveList, userList })
this.initDownloadList(downloadList) // 初始化下载列表
this.initPlayInfo()
})
},
initDownloadList(downloadList) {
@@ -299,6 +303,27 @@ export default {
}
})
},
initPlayInfo() {
rendererInvoke(NAMES.mainWindow.get_data, 'playInfo').then(info => {
// console.log(info, window.allList)
if (!info) return
if (info.listId) {
const list = window.allList[info.listId]
// console.log(list)
if (!list) return
info.list = list.list
}
window.restorePlayInfo = info
this.setPlayList({
list: {
list: info.list,
id: info.listId,
},
index: info.index,
})
})
},
showUpdateModal() {
(this.version.newVersion && this.version.newVersion.history
? Promise.resolve(this.version.newVersion)