mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
remove thumbnail cache
This commit is contained in:
@@ -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
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user