remove thumbnail cache

This commit is contained in:
austinried
2022-03-22 14:06:30 +09:00
parent 2069115df5
commit e0db4931f1
6 changed files with 32 additions and 34 deletions

View File

@@ -1,9 +1,26 @@
const migrations: Array<(state: any) => any> = [
state => {
for (let server of state.settings.servers) {
import { Store } from './store'
import RNFS from 'react-native-fs'
import { rmdir } from '@app/util/fs'
const migrations: Array<(state: any) => Promise<any>> = [
async state => {
for (const server of state.settings.servers) {
server.usePlainPassword = false
}
return state
},
async state => {
const store = state as Store
const keysToDelete = ['coverArtThumb', 'artistArtThumb']
for (const serverId in store.cacheDirs) {
for (const key in keysToDelete) {
await rmdir(`${RNFS.DocumentDirectoryPath}/servers/${serverId}/${key}`)
delete state.cacheFiles[serverId][key]
}
}
return state
},
]