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