catch exceptions thrown at deleting media from db

This commit is contained in:
tibbi 2021-06-28 19:00:24 +02:00
parent 1b612a8de2
commit 2bd6614b9b

View file

@ -742,11 +742,14 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
} }
if (mediaToDelete.isNotEmpty()) { if (mediaToDelete.isNotEmpty()) {
try {
mediaDB.deleteMedia(*mediaToDelete.toTypedArray()) 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()
} catch (ignored: Exception) { } catch (ignored: Exception) {