From 73698398a5376b205e5875dfeea1c3c737c0464d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 21 Dec 2018 22:01:11 +0100 Subject: [PATCH] retrieve file name a bit later at fetching files --- .../gallery/pro/helpers/MediaFetcher.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 258cc2934..aeec7fda0 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 @@ -194,12 +194,12 @@ class MediaFetcher(val context: Context) { break } - val filename = file.name - val isImage = filename.isImageFast() - val isVideo = if (isImage) false else filename.isVideoFast() - val isGif = if (isImage || isVideo) false else filename.isGif() - val isRaw = if (isImage || isVideo || isGif) false else filename.isRawFast() - val isSvg = if (isImage || isVideo || isGif || isRaw) false else filename.isSvg() + val path = file.absolutePath + val isImage = path.isImageFast() + val isVideo = if (isImage) false else path.isVideoFast() + val isGif = if (isImage || isVideo) false else path.isGif() + val isRaw = if (isImage || isVideo || isGif) false else path.isRawFast() + val isSvg = if (isImage || isVideo || isGif || isRaw) false else path.isSvg() if (!isImage && !isVideo && !isGif && !isRaw && !isSvg) continue @@ -219,6 +219,7 @@ class MediaFetcher(val context: Context) { if (isSvg && filterMedia and TYPE_SVGS == 0) continue + val filename = file.name if (!showHidden && filename.startsWith('.')) continue @@ -226,7 +227,6 @@ class MediaFetcher(val context: Context) { if (size <= 0L || (doExtraCheck && !file.exists())) continue - val path = file.absolutePath if (folder == RECYCLE_BIN) { deletedMedia.firstOrNull { it.path == path }?.apply { media.add(this)