Skip to content

Commit

Permalink
Merge pull request #177 from NNowakowski/resume-last-song-on-start
Browse files Browse the repository at this point in the history
Added function to toggle resuming of last song when app starts
  • Loading branch information
th-ch authored Mar 4, 2021
2 parents 6fd1668 + 9aaae7b commit 0dcf820
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const defaultConfig = {
restartOnConfigChanges: false,
trayClickPlayPause: false,
autoResetAppCache: false,
resumeSongOnStart: true
},
plugins: {
// Enabled plugins
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
8 changes: 8 additions & 0 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
? [
{
Expand Down

0 comments on commit 0dcf820

Please sign in to comment.