From 0d0153323106fd937eb254de369fa71ce320c810 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 May 2020 11:56:30 +0200 Subject: [PATCH] fix #1818, be less agressive at Favorite items cleanup --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 559e949a5..79794510f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -606,6 +606,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag try { val mediaToDelete = ArrayList() + // creating a new thread intentionally, do not reuse the common background thread Thread { media.filter { !getDoesFilePathExist(it.path, OTGPath) }.forEach { if (it.path.startsWith(recycleBinPath)) { @@ -699,7 +700,6 @@ fun Context.deleteDBPath(path: String) { fun Context.deleteMediumWithPath(path: String) { try { mediaDB.deleteMediumPath(path) - favoritesDB.deleteFavoritePath(path) } catch (ignored: Exception) { } }