From 4339a42eb301f52539241f2cf23e4e26cb93ed02 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 14 Jan 2021 11:23:42 +0100 Subject: [PATCH] fetch last modified more often, it is needed at cache --- .../gallery/pro/helpers/MediaFetcher.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 00fda35a9..867894f2b 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 @@ -319,14 +319,16 @@ class MediaFetcher(val context: Context) { media.add(this) } } else { - var lastModified = 0L - if (getProperLastModified) { - var newLastModified = lastModifieds.remove(path) - if (newLastModified == null) { - newLastModified = file.lastModified() + var lastModified: Long + var newLastModified = lastModifieds.remove(path) + if (newLastModified == null) { + newLastModified = if (getProperLastModified) { + file.lastModified() + } else { + 0L } - lastModified = newLastModified } + lastModified = newLastModified var dateTaken = lastModified val videoDuration = if (getVideoDurations && isVideo) context.getDuration(path) ?: 0 else 0