mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Add option to reset cache
This commit is contained in:
@ -13,6 +13,7 @@ const defaultConfig = {
|
|||||||
disableHardwareAcceleration: false,
|
disableHardwareAcceleration: false,
|
||||||
restartOnConfigChanges: false,
|
restartOnConfigChanges: false,
|
||||||
trayClickPlayPause: false,
|
trayClickPlayPause: false,
|
||||||
|
autoResetAppCache: false,
|
||||||
},
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
// Enabled plugins
|
// Enabled plugins
|
||||||
|
|||||||
5
index.js
5
index.js
@ -196,6 +196,11 @@ app.on("activate", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.on("ready", () => {
|
app.on("ready", () => {
|
||||||
|
if (config.get("options.autoResetAppCache")) {
|
||||||
|
// Clear cache
|
||||||
|
electron.session.defaultSession.clearCache();
|
||||||
|
}
|
||||||
|
|
||||||
mainWindow = createMainWindow();
|
mainWindow = createMainWindow();
|
||||||
setApplicationMenu(mainWindow);
|
setApplicationMenu(mainWindow);
|
||||||
if (config.get("options.restartOnConfigChanges")) {
|
if (config.get("options.restartOnConfigChanges")) {
|
||||||
|
|||||||
8
menu.js
8
menu.js
@ -58,6 +58,14 @@ const mainMenuTemplate = (win) => [
|
|||||||
config.set("options.restartOnConfigChanges", item.checked);
|
config.set("options.restartOnConfigChanges", item.checked);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Reset App cache when app starts",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: config.get("options.autoResetAppCache"),
|
||||||
|
click: (item) => {
|
||||||
|
config.set("options.autoResetAppCache", item.checked);
|
||||||
|
},
|
||||||
|
},
|
||||||
...(is.windows() || is.linux()
|
...(is.windows() || is.linux()
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user