mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-19 13:30:36 +01:00
catch exceptions thrown at deleting media from db
This commit is contained in:
parent
1b612a8de2
commit
2bd6614b9b
@ -742,10 +742,13 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mediaToDelete.isNotEmpty()) {
|
if (mediaToDelete.isNotEmpty()) {
|
||||||
mediaDB.deleteMedia(*mediaToDelete.toTypedArray())
|
try {
|
||||||
|
mediaDB.deleteMedia(*mediaToDelete.toTypedArray())
|
||||||
|
|
||||||
mediaToDelete.filter { it.isFavorite }.forEach {
|
mediaToDelete.filter { it.isFavorite }.forEach {
|
||||||
favoritesDB.deleteFavoritePath(it.path)
|
favoritesDB.deleteFavoritePath(it.path)
|
||||||
|
}
|
||||||
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user