添加源有效性校验

pull/930/merge
lyswhut 2022-03-30 13:14:10 +08:00
parent bca5b13516
commit 5099ba9c96
5 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,4 @@
特别说明一下,Scheme URL其实是支持Linux系统的但好像需要deb之类的安装包创建出`.desktop`文件才行。 特别说明Scheme URL其实是支持Linux系统的但好像需要deb之类的安装包创建出`.desktop`文件才行。
### 新增 ### 新增
@ -16,7 +16,7 @@
- 修复Linux无法全屏的问题 - 修复Linux无法全屏的问题
- 修复播放下载列表的歌曲时使用Windows任务栏缩略图工具栏控制按钮的收藏按钮收藏歌曲时的异常问题 - 修复播放下载列表的歌曲时使用Windows任务栏缩略图工具栏控制按钮的收藏按钮收藏歌曲时的异常问题
- 修复不启用热门搜索时,搜索历史不显示的问题 - 修复启用搜索历史但不启用热门搜索时,搜索历史不显示的问题
### 变更 ### 变更

View File

@ -30,6 +30,9 @@ const getters = {
sources(state, getters, rootState, { sourceNames }) { sources(state, getters, rootState, { sourceNames }) {
return sources.map(item => ({ id: item.id, name: sourceNames[item.id] })) return sources.map(item => ({ id: item.id, name: sourceNames[item.id] }))
}, },
sourceIds() {
return sources.map(item => item.id)
},
boards(state) { boards(state) {
return state.boards return state.boards
}, },

View File

@ -52,7 +52,7 @@ sources.forEach(source => {
// getters // getters
const getters = { const getters = {
sourceInfo(state, getters, rootState, { sourceNames }) { sourceInfo(state, getters, rootState, { sourceNames }) {
return { sources: sources.map(item => ({ id: item.id, name: sourceNames[item.id] })), sortList } return { sourceIds: sources.map(item => item.id), sources: sources.map(item => ({ id: item.id, name: sourceNames[item.id] })), sortList }
}, },
tags: state => state.tags, tags: state => state.tags,
isVisibleListDetail: state => state.isVisibleListDetail, isVisibleListDetail: state => state.isVisibleListDetail,

View File

@ -78,7 +78,7 @@ export default {
}, },
computed: { computed: {
...mapGetters(['setting']), ...mapGetters(['setting']),
...mapGetters('leaderboard', ['sources', 'boards', 'info']), ...mapGetters('leaderboard', ['sources', 'sourceIds', 'boards', 'info']),
boardList() { boardList() {
return this.source && this.boards[this.source] ? this.boards[this.source] : [] return this.source && this.boards[this.source] ? this.boards[this.source] : []
}, },
@ -129,6 +129,7 @@ export default {
}, },
mounted() { mounted() {
this.source = this.setting.leaderboard.source this.source = this.setting.leaderboard.source
if (!this.sourceIds.includes(this.source)) this.source = this.sourceIds[0]
this.tabId = this.setting.leaderboard.tabId this.tabId = this.setting.leaderboard.tabId
this.page = this.listInfo.page this.page = this.listInfo.page
}, },

View File

@ -97,7 +97,7 @@ export default {
case 'tx': case 'tx':
case 'mg': case 'mg':
case 'kg': case 'kg':
case 'xm': // case 'xm':
list.push({ list.push({
name: this.$t('songlist__open_list', { name: this.sourceInfo.sources.find(s => s.id == this.source).name }), name: this.$t('songlist__open_list', { name: this.sourceInfo.sources.find(s => s.id == this.source).name }),
id: 'importSongList', id: 'importSongList',
@ -164,6 +164,7 @@ export default {
}, },
mounted() { mounted() {
this.source = this.setting.songList.source this.source = this.setting.songList.source
if (!this.sourceInfo.sourceIds.includes(this.source)) this.source = this.sourceInfo.sourceIds[0]
this.isToggleSource = true this.isToggleSource = true
this.tagInfo = this.setting.songList.tagInfo this.tagInfo = this.setting.songList.tagInfo
this.sortId = this.setting.songList.sortId this.sortId = this.setting.songList.sortId