优化切歌逻辑
parent
1cee2febf4
commit
b820adf0bf
|
@ -517,15 +517,18 @@ export default {
|
||||||
if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) {
|
if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) {
|
||||||
let index = this.playedList.indexOf(this.targetSong)
|
let index = this.playedList.indexOf(this.targetSong)
|
||||||
index -= 1
|
index -= 1
|
||||||
|
while (true) {
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
let listIndex = this.list.indexOf(this.playedList[index])
|
let listIndex = this.list.indexOf(this.playedList[index])
|
||||||
if (listIndex < 0) {
|
if (listIndex < 0) {
|
||||||
this.removePlayedList(index)
|
this.removePlayedList(index)
|
||||||
return this.handlePrev()
|
continue
|
||||||
}
|
}
|
||||||
this.setPlayIndex(listIndex)
|
this.setPlayIndex(listIndex)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let list = await this.filterList()
|
let list = await this.filterList()
|
||||||
if (!list.length) return this.setPlayIndex(-1)
|
if (!list.length) return this.setPlayIndex(-1)
|
||||||
|
@ -552,15 +555,18 @@ export default {
|
||||||
if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) {
|
if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) {
|
||||||
let index = this.playedList.indexOf(this.targetSong)
|
let index = this.playedList.indexOf(this.targetSong)
|
||||||
index += 1
|
index += 1
|
||||||
|
while (true) {
|
||||||
if (index < this.playedList.length) {
|
if (index < this.playedList.length) {
|
||||||
let listIndex = this.list.indexOf(this.playedList[index])
|
let listIndex = this.list.indexOf(this.playedList[index])
|
||||||
if (listIndex < 0) {
|
if (listIndex < 0) {
|
||||||
this.removePlayedList(index)
|
this.removePlayedList(index)
|
||||||
return this.handleNext()
|
continue
|
||||||
}
|
}
|
||||||
this.setPlayIndex(listIndex)
|
this.setPlayIndex(listIndex)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let list = await this.filterList()
|
let list = await this.filterList()
|
||||||
if (!list.length) return this.setPlayIndex(-1)
|
if (!list.length) return this.setPlayIndex(-1)
|
||||||
|
|
Loading…
Reference in New Issue