From 4fcd1b0fb693815d7862d0f788c33aa20969d783 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 27 Feb 2019 13:59:10 +0100 Subject: [PATCH] do not check if the folder is recycle bin at fetching files --- .../simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 57c50e47b..9b8150e51 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -158,7 +158,8 @@ class MediaFetcher(val context: Context) { favoritePaths: ArrayList, getVideoDurations: Boolean): ArrayList { val media = ArrayList() - val deletedMedia = if (folder == RECYCLE_BIN) { + val isRecycleBin = folder == RECYCLE_BIN + val deletedMedia = if (isRecycleBin) { context.getUpdatedDeletedMedia(context.galleryDB.MediumDao()) } else { ArrayList() @@ -166,7 +167,7 @@ class MediaFetcher(val context: Context) { val doExtraCheck = context.config.doExtraCheck val showHidden = context.config.shouldShowHidden - val dateTakens = if (getProperDateTaken && folder != FAVORITES && folder != RECYCLE_BIN) getFolderDateTakens(folder) else HashMap() + val dateTakens = if (getProperDateTaken && folder != FAVORITES && !isRecycleBin) getFolderDateTakens(folder) else HashMap() val files = when (folder) { FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toTypedArray() @@ -212,7 +213,7 @@ class MediaFetcher(val context: Context) { if (size <= 0L || (doExtraCheck && !file.exists())) continue - if (folder == RECYCLE_BIN) { + if (isRecycleBin) { deletedMedia.firstOrNull { it.path == path }?.apply { media.add(this) }