diff --git a/src/renderer/index.js b/src/renderer/index.js index a680b48a..e6ab3c2b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2458,11 +2458,19 @@ const app = new Vue({ app.mk.setQueue({[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).then(function () { if ((app.showingPlaylist && app.showingPlaylist.id == id)) { - let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item)); - let u = query; + let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item)), + u; + + u = query; + if (app.mk.shuffleMode == 1) { shuffleArray(u) + } else { + for (let i = 0; i < app.showingPlaylist.relationships.tracks.data.length; i++) { + if (app.showingPlaylist.relationships.tracks.data[i].id == item.id) u.splice(0, i+1); + } } + app.mk.queue.append(u) } else { app.getPlaylistFromID(id, true).then(function () {