Merge branch 'master' of github.com:SimpleMobileTools/Simple-Gallery

This commit is contained in:
tibbi 2021-12-17 15:26:46 +01:00
commit edb25a6053

View file

@ -439,7 +439,7 @@ class MediaFetcher(val context: Context) {
val filename = cursor.getStringValue(Images.Media.DISPLAY_NAME)
val path = cursor.getStringValue(Images.Media.DATA)
val lastModified = cursor.getLongValue(Images.Media.DATE_MODIFIED) * 1000
val dateTaken = cursor.getLongValue(Images.Media.DATE_TAKEN)
var dateTaken = cursor.getLongValue(Images.Media.DATE_TAKEN)
val size = cursor.getLongValue(Images.Media.SIZE)
val videoDuration = Math.round(cursor.getIntValue(MediaStore.MediaColumns.DURATION) / 1000.toDouble()).toInt()
@ -485,6 +485,10 @@ class MediaFetcher(val context: Context) {
else -> TYPE_IMAGES
}
if (dateTaken == 0L) {
dateTaken = lastModified
}
val isFavorite = favoritePaths.contains(path)
val medium =
Medium(null, filename, path, path.getParentPath(), lastModified, dateTaken, size, type, videoDuration, isFavorite, 0L, mediaStoreId)