persist cache map for cover art

This commit is contained in:
austinried
2021-08-13 16:19:30 +09:00
parent d1824a70be
commit 9cacc4de36
7 changed files with 114 additions and 71 deletions

View File

@@ -61,11 +61,21 @@ export const createSettingsSlice = (set: SetState<Store>, get: GetState<Store>):
set(
produce<Store>(state => {
state.settings.activeServer = id
state.settings.activeServer = newActiveServer.id
state.client = new SubsonicApiClient(newActiveServer)
state.coverArtDir = coverArtDir
state.artistArtDir = artistArtDir
state.songsDir = songsDir
state.cache[newActiveServer.id] = state.cache[newActiveServer.id] || {
files: {
coverArt: {},
artistArt: {},
songs: {},
},
songs: {},
albums: {},
artists: {},
}
}),
)
},