新增单个列表导入/导出功能
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
getMusicUrl as getMusicUrlFormStorage,
|
||||
setMusicUrl,
|
||||
assertApiSupport,
|
||||
filterFileName,
|
||||
} from '../../utils'
|
||||
import { NAMES, rendererInvoke } from '@common/ipc'
|
||||
|
||||
@@ -33,7 +34,6 @@ const dls = {}
|
||||
const tryNum = {}
|
||||
let isRuningActionTask = false
|
||||
|
||||
const filterFileName = /[\\/:*?#"<>|]/g
|
||||
|
||||
// getters
|
||||
const getters = {
|
||||
@@ -378,9 +378,9 @@ const actions = {
|
||||
statusText: '待下载',
|
||||
url: null,
|
||||
// songmid: musicInfo.songmid,
|
||||
fileName: `${rootState.setting.download.fileName
|
||||
fileName: filterFileName(`${rootState.setting.download.fileName
|
||||
.replace('歌名', musicInfo.name)
|
||||
.replace('歌手', musicInfo.singer)}.${ext}`.replace(filterFileName, ''),
|
||||
.replace('歌手', musicInfo.singer)}.${ext}`),
|
||||
progress: {
|
||||
downloaded: 0,
|
||||
total: 0,
|
||||
|
||||
@@ -293,11 +293,11 @@ const mutations = {
|
||||
const targetMusicInfo = targetList.list.find(item => item.songmid == id)
|
||||
if (targetMusicInfo) Object.assign(targetMusicInfo, data)
|
||||
},
|
||||
createUserList(state, { name, id = `userlist_${Date.now()}`, list = [], source, sourceListId, isSync }) {
|
||||
createUserList(state, { name, id = `userlist_${Date.now()}`, list = [], source, sourceListId, position, isSync }) {
|
||||
if (!isSync) {
|
||||
window.eventHub.$emit(eventSyncName.send_action_list, {
|
||||
action: 'create_user_list',
|
||||
data: { name, id, list, source, sourceListId },
|
||||
data: { name, id, list, source, sourceListId, position },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -311,7 +311,11 @@ const mutations = {
|
||||
source,
|
||||
sourceListId,
|
||||
}
|
||||
state.userList.push(newList)
|
||||
if (position == null) {
|
||||
state.userList.push(newList)
|
||||
} else {
|
||||
state.userList.splice(position + 1, 0, newList)
|
||||
}
|
||||
allListUpdate(newList)
|
||||
}
|
||||
this.commit('list/listAddMultiple', { id, list, isSync: true })
|
||||
|
||||
Reference in New Issue
Block a user