From 650a985a9cecc0676bf3ea0ba92fe818cf0d7279 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 27 Jan 2020 21:05:05 +0100 Subject: [PATCH] make the Date Taken from Fix Date Taken value be higher priority than mediastore --- .../simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 6a4db386a..955ce9eed 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 @@ -407,8 +407,8 @@ class MediaFetcher(val context: Context) { try { val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) if (dateTaken != 0L) { - val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) - dateTakens[path] = dateTaken + val name = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) + dateTakens[name] = dateTaken } } catch (e: Exception) { } @@ -416,6 +416,10 @@ class MediaFetcher(val context: Context) { } } + context.dateTakensDB.getDateTakensFromPath(folder).forEach { + dateTakens[it.filename] = it.taken + } + return dateTakens }