mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
be more agressive at deleting corrupt cached files
This commit is contained in:
@ -611,12 +611,14 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
|
|||||||
val newMedia = it
|
val newMedia = it
|
||||||
try {
|
try {
|
||||||
gotMedia(newMedia, false)
|
gotMedia(newMedia, false)
|
||||||
oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.forEach {
|
|
||||||
if (!getDoesFilePathExist(it.path)) {
|
val newPaths = newMedia.mapNotNull { it as? Medium }.map { it.path }
|
||||||
mediaDB.deleteMediumPath(it.path)
|
oldMedia.mapNotNull { it as? Medium }.filter { !newPaths.contains(it.path) }.forEach {
|
||||||
} else if (mPath == FAVORITES) {
|
if (mPath == FAVORITES && getDoesFilePathExist(it.path)) {
|
||||||
favoritesDB.deleteFavoritePath(it.path)
|
favoritesDB.deleteFavoritePath(it.path)
|
||||||
mediaDB.updateFavorite(it.path, false)
|
mediaDB.updateFavorite(it.path, false)
|
||||||
|
} else {
|
||||||
|
mediaDB.deleteMediumPath(it.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Reference in New Issue
Block a user