Style changes for review

This commit is contained in:
Jonathan Müller
2022-06-14 19:43:36 +02:00
parent 6e1c50ede1
commit bba499044b
2 changed files with 4 additions and 4 deletions

View File

@ -52,11 +52,11 @@ function registerMPRIS(win) {
player.on("loopStatus", (status) => { player.on("loopStatus", (status) => {
// switchRepeat cycles between states in that order // switchRepeat cycles between states in that order
const switches = ["None", "Playlist", "Track"]; const switches = ["None", "Playlist", "Track"];
const curIdx = switches.indexOf(currentLoopStatus); const currentIndex = switches.indexOf(currentLoopStatus);
const newIdx = switches.indexOf(status); const targetIndex = switches.indexOf(status);
// Get a delta in the range [0,2] // Get a delta in the range [0,2]
const delta = ((newIdx - curIdx) % 3 + 3) % 3; const delta = (targetIndex - currentIndex + 3) % 3;
manuallySwitchingStatus = true; manuallySwitchingStatus = true;
songControls.switchRepeat(delta); songControls.switchRepeat(delta);

View File

@ -21,7 +21,7 @@ module.exports = (win) => {
go1sForward: () => pressKey(win, "l", ["shift"]), go1sForward: () => pressKey(win, "l", ["shift"]),
shuffle: () => pressKey(win, "s"), shuffle: () => pressKey(win, "s"),
switchRepeat: (n = 1) => { switchRepeat: (n = 1) => {
for (let i = 0; i != n; ++i) for (let i = 0; i < n; i++)
pressKey(win, "r"); pressKey(win, "r");
}, },
// General // General