mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 18:21:47 +00:00
Fix resumeOnStart option
This commit is contained in:
@ -14,7 +14,7 @@ const defaultConfig = {
|
|||||||
restartOnConfigChanges: false,
|
restartOnConfigChanges: false,
|
||||||
trayClickPlayPause: false,
|
trayClickPlayPause: false,
|
||||||
autoResetAppCache: false,
|
autoResetAppCache: false,
|
||||||
resumeSongOnStart: true
|
resumeOnStart: true,
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
// Enabled plugins
|
// Enabled plugins
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
const defaultConfig = require("./defaults");
|
||||||
const plugins = require("./plugins");
|
const plugins = require("./plugins");
|
||||||
const store = require("./store");
|
const store = require("./store");
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ const get = (key) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
defaultConfig,
|
||||||
get,
|
get,
|
||||||
set,
|
set,
|
||||||
edit: () => store.openInEditor(),
|
edit: () => store.openInEditor(),
|
||||||
|
|||||||
@ -3,6 +3,11 @@ const Store = require("electron-store");
|
|||||||
const defaults = require("./defaults");
|
const defaults = require("./defaults");
|
||||||
|
|
||||||
const migrations = {
|
const migrations = {
|
||||||
|
">=1.11.0": (store) => {
|
||||||
|
if (store.get("options.resumeOnStart") === undefined) {
|
||||||
|
store.set("options.resumeOnStart", true);
|
||||||
|
}
|
||||||
|
},
|
||||||
">=1.7.0": (store) => {
|
">=1.7.0": (store) => {
|
||||||
const enabledPlugins = store.get("plugins");
|
const enabledPlugins = store.get("plugins");
|
||||||
if (!Array.isArray(enabledPlugins)) {
|
if (!Array.isArray(enabledPlugins)) {
|
||||||
|
|||||||
4
index.js
4
index.js
@ -111,7 +111,9 @@ function createMainWindow() {
|
|||||||
win.maximize();
|
win.maximize();
|
||||||
}
|
}
|
||||||
|
|
||||||
const urlToLoad = config.get("resumeOnStart") ? config.get("url") : "https://music.youtube.com";
|
const urlToLoad = config.get("options.resumeOnStart")
|
||||||
|
? config.get("url")
|
||||||
|
: config.defaultConfig.url;
|
||||||
win.webContents.loadURL(urlToLoad);
|
win.webContents.loadURL(urlToLoad);
|
||||||
win.on("closed", onClosed);
|
win.on("closed", onClosed);
|
||||||
|
|
||||||
|
|||||||
6
menu.js
6
menu.js
@ -69,10 +69,10 @@ const mainMenuTemplate = (win) => [
|
|||||||
{
|
{
|
||||||
label: "Resume last song when app starts",
|
label: "Resume last song when app starts",
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
checked: config.get("options.resumeSongOnStart"),
|
checked: config.get("options.resumeOnStart"),
|
||||||
click: (item) => {
|
click: (item) => {
|
||||||
config.set("options.resumeSongOnStart", item.checked);
|
config.set("options.resumeOnStart", item.checked);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
...(is.windows() || is.linux()
|
...(is.windows() || is.linux()
|
||||||
? [
|
? [
|
||||||
|
|||||||
Reference in New Issue
Block a user