🚀 Added function to toggle resuming of last song when app starts

This commit is contained in:
Nico Nowakowski
2021-03-04 14:14:49 +01:00
parent 5641c3fc87
commit 9aaae7b2d9
3 changed files with 11 additions and 1 deletions

View File

@ -14,6 +14,7 @@ const defaultConfig = {
restartOnConfigChanges: false, restartOnConfigChanges: false,
trayClickPlayPause: false, trayClickPlayPause: false,
autoResetAppCache: false, autoResetAppCache: false,
resumeSongOnStart: true
}, },
plugins: { plugins: {
// Enabled plugins // Enabled plugins

View File

@ -111,7 +111,8 @@ function createMainWindow() {
win.maximize(); win.maximize();
} }
win.webContents.loadURL(config.get("url")); const urlToLoad = config.get("resumeOnStart") ? config.get("url") : "https://music.youtube.com";
win.webContents.loadURL(urlToLoad);
win.on("closed", onClosed); win.on("closed", onClosed);
win.on("move", () => { win.on("move", () => {

View File

@ -66,6 +66,14 @@ const mainMenuTemplate = (win) => [
config.set("options.autoResetAppCache", item.checked); config.set("options.autoResetAppCache", item.checked);
}, },
}, },
{
label: "Resume last song when app starts",
type: "checkbox",
checked: config.get("options.resumeSongOnStart"),
click: (item) => {
config.set("options.resumeSongOnStart", item.checked);
}
},
...(is.windows() || is.linux() ...(is.windows() || is.linux()
? [ ? [
{ {