mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-03 15:02:08 +08:00
修复临时列表变更会意外触发同步的问题
This commit is contained in:
parent
f032eed94f
commit
0b685da0bc
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
- 修复主题背景覆盖不全的问题
|
- 修复主题背景覆盖不全的问题
|
||||||
- 修复清理缓存后查看日志时会导致APP崩溃的问题
|
- 修复清理缓存后查看日志时会导致APP崩溃的问题
|
||||||
|
- 修复临时列表变更会意外触发同步的问题
|
||||||
|
|
||||||
### 变更
|
### 变更
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export const registerListActionEvent = (sendListAction: (action: LX.Sync.List.Ac
|
|||||||
await sendListAction({ action: 'list_update_position', data: { position, ids } })
|
await sendListAction({ action: 'list_update_position', data: { position, ids } })
|
||||||
}
|
}
|
||||||
const list_music_overwrite = async(listId: string, musicInfos: LX.Music.MusicInfo[], isRemote: boolean = false) => {
|
const list_music_overwrite = async(listId: string, musicInfos: LX.Music.MusicInfo[], isRemote: boolean = false) => {
|
||||||
if (isRemote) return
|
if (isRemote || listId == LIST_IDS.TEMP) return
|
||||||
await sendListAction({ action: 'list_music_overwrite', data: { listId, musicInfos } })
|
await sendListAction({ action: 'list_music_overwrite', data: { listId, musicInfos } })
|
||||||
}
|
}
|
||||||
const list_music_add = async(id: string, musicInfos: LX.Music.MusicInfo[], addMusicLocationType: LX.AddMusicLocationType, isRemote: boolean = false) => {
|
const list_music_add = async(id: string, musicInfos: LX.Music.MusicInfo[], addMusicLocationType: LX.AddMusicLocationType, isRemote: boolean = false) => {
|
||||||
@ -68,11 +68,12 @@ export const registerListActionEvent = (sendListAction: (action: LX.Sync.List.Ac
|
|||||||
await sendListAction({ action: 'list_music_move', data: { fromId, toId, musicInfos, addMusicLocationType } })
|
await sendListAction({ action: 'list_music_move', data: { fromId, toId, musicInfos, addMusicLocationType } })
|
||||||
}
|
}
|
||||||
const list_music_remove = async(listId: string, ids: string[], isRemote: boolean = false) => {
|
const list_music_remove = async(listId: string, ids: string[], isRemote: boolean = false) => {
|
||||||
if (isRemote) return
|
if (isRemote || listId == LIST_IDS.TEMP) return
|
||||||
await sendListAction({ action: 'list_music_remove', data: { listId, ids } })
|
await sendListAction({ action: 'list_music_remove', data: { listId, ids } })
|
||||||
}
|
}
|
||||||
const list_music_update = async(musicInfos: LX.List.ListActionMusicUpdate, isRemote: boolean = false) => {
|
const list_music_update = async(musicInfos: LX.List.ListActionMusicUpdate, isRemote: boolean = false) => {
|
||||||
if (isRemote) return
|
musicInfos = musicInfos.filter(item => item.id != LIST_IDS.TEMP)
|
||||||
|
if (isRemote || !musicInfos.length) return
|
||||||
await sendListAction({ action: 'list_music_update', data: musicInfos })
|
await sendListAction({ action: 'list_music_update', data: musicInfos })
|
||||||
}
|
}
|
||||||
const list_music_clear = async(ids: string[], isRemote: boolean = false) => {
|
const list_music_clear = async(ids: string[], isRemote: boolean = false) => {
|
||||||
@ -80,7 +81,7 @@ export const registerListActionEvent = (sendListAction: (action: LX.Sync.List.Ac
|
|||||||
await sendListAction({ action: 'list_music_clear', data: ids })
|
await sendListAction({ action: 'list_music_clear', data: ids })
|
||||||
}
|
}
|
||||||
const list_music_update_position = async(listId: string, position: number, ids: string[], isRemote: boolean = false) => {
|
const list_music_update_position = async(listId: string, position: number, ids: string[], isRemote: boolean = false) => {
|
||||||
if (isRemote) return
|
if (isRemote || listId == LIST_IDS.TEMP) return
|
||||||
await sendListAction({ action: 'list_music_update_position', data: { listId, position, ids } })
|
await sendListAction({ action: 'list_music_update_position', data: { listId, position, ids } })
|
||||||
}
|
}
|
||||||
global.list_event.on('list_data_overwrite', list_data_overwrite)
|
global.list_event.on('list_data_overwrite', list_data_overwrite)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user