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 }