Merge pull request #177 from NNowakowski/resume-last-song-on-start

Added function to toggle resuming of last song when app starts
This commit is contained in:
th-ch
2021-03-04 22:57:41 +01:00
committed by GitHub
3 changed files with 11 additions and 1 deletions

View File

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

View File

@ -111,7 +111,8 @@ function createMainWindow() {
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("move", () => {

View File

@ -66,6 +66,14 @@ const mainMenuTemplate = (win) => [
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()
? [
{