This commit is contained in:
lyswhut
2022-10-29 11:36:35 +08:00
parent 66b965d9f7
commit e45cee6596
715 changed files with 57096 additions and 31771 deletions
+23
View File
@@ -0,0 +1,23 @@
import { addTempPlayList } from '@renderer/store/player/action'
import { playList } from '@renderer/core/player'
import { LIST_IDS } from '@common/constants'
export default ({ selectedList, list, listAll, removeAllSelect }) => {
const handlePlayMusic = (index) => {
playList(LIST_IDS.DOWNLOAD, listAll.value.indexOf(list.value[index]))
}
const handlePlayMusicLater = (index, single) => {
if (selectedList.value.length && !single) {
addTempPlayList(selectedList.value.map(s => ({ listId: LIST_IDS.DOWNLOAD, musicInfo: s })))
removeAllSelect()
} else {
addTempPlayList([{ listId: LIST_IDS.DOWNLOAD, musicInfo: list.value[index] }])
}
}
return {
handlePlayMusic,
handlePlayMusicLater,
}
}