mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Style changes for review
This commit is contained in:
@ -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);
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user