From c930ed5cdacaf99455fdd2e73a4e5c705b73a175 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 9 Jan 2018 00:19:11 +0100 Subject: [PATCH] store latestMediaId only when not from cache, should improve new media discovery --- .../simplemobiletools/gallery/activities/MainActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 756273df9..53a70a411 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -527,9 +527,11 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun gotDirectories(newDirs: ArrayList, isFromCache: Boolean) { - Thread { - mLatestMediaId = getLatestMediaId() - }.start() + if (!isFromCache) { + Thread { + mLatestMediaId = getLatestMediaId() + }.start() + } val dirs = getSortedDirectories(newDirs) directories_refresh_layout.isRefreshing = false