fix playback of library songs on shuffle

This commit is contained in:
vapormusic 2022-01-23 23:45:01 +07:00
parent 25f53f9b72
commit 0bbf4ee4b3

View file

@ -2514,24 +2514,30 @@ const app = new Vue({
app.mk.stop().then(() => { app.mk.stop().then(() => {
this.mk.clearQueue().then(function(_) { if (item) {
if (app.mk.shuffleMode == 1) { app.mk.setQueue({
shuffleArray(query) [item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
} }).then(function () {
app.mk.queue.append(query) app.mk.play().then(() => {
if (childIndex != -1) { if (app.mk.shuffleMode == 1) {
app.mk.changeToMediaAtIndex(childIndex) shuffleArray(query)
} else if (item) { }
app.mk.playNext({ app.mk.queue.append(query)
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
}).then(function() {
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1)
app.mk.play()
}) })
} else { })
app.mk.play() } else {
} this.mk.clearQueue().then(function (_) {
}) if (app.mk.shuffleMode == 1) {
shuffleArray(query)
}
app.mk.queue.append(query)
if (childIndex != -1) {
app.mk.changeToMediaAtIndex(childIndex)
} else {
app.mk.play()
}
})
}
}) })
} else { } else {
app.mk.stop().then(() => { app.mk.stop().then(() => {