From 7fdcaf92289516df524553dbbca8b04af31fc17f Mon Sep 17 00:00:00 2001 From: N0chteil <53608074+N0chteil@users.noreply.github.com> Date: Sun, 23 Jan 2022 16:39:34 +0100 Subject: [PATCH 1/3] Update index.js --- src/renderer/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index a680b48a..ea6ea455 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2458,8 +2458,15 @@ 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; + + 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); + } + if (app.mk.shuffleMode == 1) { shuffleArray(u) } From 957733a4e1d6a79c748edca3c987d340f1648d4e Mon Sep 17 00:00:00 2001 From: N0chteil <53608074+N0chteil@users.noreply.github.com> Date: Sun, 23 Jan 2022 16:43:50 +0100 Subject: [PATCH 2/3] Update index.js --- src/renderer/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index ea6ea455..502d69df 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2463,13 +2463,14 @@ const app = new Vue({ u = query; - 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); - } - 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); + } } + app.mk.queue.append(u) } else { app.getPlaylistFromID(id, true).then(function () { From e0833baaee08e8726b9d4d9810d79b3450c32af1 Mon Sep 17 00:00:00 2001 From: N0chteil <53608074+N0chteil@users.noreply.github.com> Date: Sun, 23 Jan 2022 16:46:06 +0100 Subject: [PATCH 3/3] Don't play the same song twice --- src/renderer/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 502d69df..e6ab3c2b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -2467,7 +2467,7 @@ const app = new Vue({ 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); + if (app.showingPlaylist.relationships.tracks.data[i].id == item.id) u.splice(0, i+1); } }