From d51fa1385a4e49878b6e9d25c1b5256bb85b455c Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 17 Dec 2021 12:25:32 +0100 Subject: [PATCH] avoid refreshing favorite items unnecessarily --- .../simplemobiletools/gallery/pro/activities/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index c20919dbc..ebc4a0911 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -966,7 +966,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { // update directories and media files in the local db, delete invalid items. Intentionally creating a new thread updateDBDirectory(directory) - if (!directory.isRecycleBin()) { + if (!directory.isRecycleBin() && !directory.areFavorites()) { Thread { try { mediaDB.insertAll(curMedia) @@ -1065,7 +1065,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { Thread { try { directoryDao.insert(newDir) - if (folder != RECYCLE_BIN) { + if (folder != RECYCLE_BIN && folder != FAVORITES) { mediaDB.insertAll(newMedia) } } catch (ignored: Exception) {