mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
PiP options defaults + migrations
This commit is contained in:
@ -82,6 +82,13 @@ const defaultConfig = {
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
forceHide: false,
|
forceHide: false,
|
||||||
},
|
},
|
||||||
|
"picture-in-picture": {
|
||||||
|
"enabled": false,
|
||||||
|
"alwaysOnTop": true,
|
||||||
|
"savePosition": true,
|
||||||
|
"saveSize": false,
|
||||||
|
"hotkey": "P"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,16 @@ const Store = require("electron-store");
|
|||||||
|
|
||||||
const defaults = require("./defaults");
|
const defaults = require("./defaults");
|
||||||
|
|
||||||
|
const setDefaultPluginOptions = (store, plugin) => {
|
||||||
|
if (!store.get(`plugins.${plugin}`)) {
|
||||||
|
store.set(`plugins.${plugin}`, defaults.plugins[plugin]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const migrations = {
|
const migrations = {
|
||||||
|
">=1.17.0": (store) => {
|
||||||
|
setDefaultPluginOptions(store, "picture-in-picture");
|
||||||
|
},
|
||||||
">=1.14.0": (store) => {
|
">=1.14.0": (store) => {
|
||||||
if (
|
if (
|
||||||
typeof store.get("plugins.precise-volume.globalShortcuts") !== "object"
|
typeof store.get("plugins.precise-volume.globalShortcuts") !== "object"
|
||||||
|
|||||||
Reference in New Issue
Block a user