diff --git a/plugins/shortcuts/mpris.js b/plugins/shortcuts/mpris.js index 7c656624..53d46ff7 100644 --- a/plugins/shortcuts/mpris.js +++ b/plugins/shortcuts/mpris.js @@ -52,11 +52,11 @@ function registerMPRIS(win) { player.on("loopStatus", (status) => { // switchRepeat cycles between states in that order const switches = ["None", "Playlist", "Track"]; - const curIdx = switches.indexOf(currentLoopStatus); - const newIdx = switches.indexOf(status); + const currentIndex = switches.indexOf(currentLoopStatus); + const targetIndex = switches.indexOf(status); // Get a delta in the range [0,2] - const delta = ((newIdx - curIdx) % 3 + 3) % 3; + const delta = (targetIndex - currentIndex + 3) % 3; manuallySwitchingStatus = true; songControls.switchRepeat(delta); diff --git a/providers/song-controls.js b/providers/song-controls.js index bd9d048e..e5b4848e 100644 --- a/providers/song-controls.js +++ b/providers/song-controls.js @@ -21,7 +21,7 @@ module.exports = (win) => { go1sForward: () => pressKey(win, "l", ["shift"]), shuffle: () => pressKey(win, "s"), switchRepeat: (n = 1) => { - for (let i = 0; i != n; ++i) + for (let i = 0; i < n; i++) pressKey(win, "r"); }, // General