mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
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:
@ -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
|
||||||
|
|||||||
3
index.js
3
index.js
@ -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", () => {
|
||||||
|
|||||||
8
menu.js
8
menu.js
@ -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()
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user