From c6640eaa9a89c69e37c1aa1403065a1e6a0f542b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 23 Oct 2021 22:04:54 +0200 Subject: [PATCH] adding a comment related to removing irrelevant cached files --- .../simplemobiletools/gallery/pro/activities/MediaActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 052cf2c0b..665e1f94f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -612,6 +612,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { try { gotMedia(newMedia, false) + // remove cached files that are no longer valid for whatever reason val newPaths = newMedia.mapNotNull { it as? Medium }.map { it.path } oldMedia.mapNotNull { it as? Medium }.filter { !newPaths.contains(it.path) }.forEach { if (mPath == FAVORITES && getDoesFilePathExist(it.path)) {