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)) {