make the Date Taken from Fix Date Taken value be higher priority than mediastore

This commit is contained in:
tibbi 2020-01-27 21:05:05 +01:00
parent 2517170aeb
commit 650a985a9c

View file

@ -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
}