store update with new options and migration to prevent errors
This commit is contained in:
parent
5a2229cf67
commit
d47c784bad
1 changed files with 16 additions and 4 deletions
|
@ -12,9 +12,14 @@ export class Store {
|
|||
},
|
||||
"general": {
|
||||
"close_button_hide": false,
|
||||
"discord_rpc": 1, // 0 = disabled, 1 = enabled as Cider, 2 = enabled as Apple Music
|
||||
"discord_rpc_clear_on_pause": true,
|
||||
"discord_rpc_hide_buttons": false,
|
||||
"discord_rpc": {
|
||||
"enabled": false,
|
||||
"client": "Cider",
|
||||
"clear_on_pause": true,
|
||||
"hide_buttons": false,
|
||||
"state_format": "by {artist}",
|
||||
"details_format": "{title}",
|
||||
},
|
||||
"language": "en_US", // electron.app.getLocale().replace('-', '_') this can be used in future
|
||||
"playbackNotifications": true,
|
||||
"update_branch": "main",
|
||||
|
@ -152,13 +157,20 @@ export class Store {
|
|||
"playlistTrackMapping": true
|
||||
}
|
||||
}
|
||||
private migrations: any = {}
|
||||
private migrations: any = {
|
||||
'1.4.3': (store: ElectronStore) => {
|
||||
if (typeof(store.get('general.discord_rpc')) == 'number') {
|
||||
store.set('general.discord_rpc', this.defaults.general.discord_rpc)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
constructor() {
|
||||
Store.cfg = new ElectronStore({
|
||||
name: 'cider-config',
|
||||
defaults: this.defaults,
|
||||
migrations: this.migrations,
|
||||
clearInvalidConfig: true
|
||||
});
|
||||
|
||||
Store.cfg.set(this.mergeStore(this.defaults, Store.cfg.store))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue