mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
Merge branch 'master' of github.com:SimpleMobileTools/Simple-Gallery
This commit is contained in:
commit
edb25a6053
1 changed files with 5 additions and 1 deletions
|
@ -439,7 +439,7 @@ class MediaFetcher(val context: Context) {
|
||||||
val filename = cursor.getStringValue(Images.Media.DISPLAY_NAME)
|
val filename = cursor.getStringValue(Images.Media.DISPLAY_NAME)
|
||||||
val path = cursor.getStringValue(Images.Media.DATA)
|
val path = cursor.getStringValue(Images.Media.DATA)
|
||||||
val lastModified = cursor.getLongValue(Images.Media.DATE_MODIFIED) * 1000
|
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 size = cursor.getLongValue(Images.Media.SIZE)
|
||||||
val videoDuration = Math.round(cursor.getIntValue(MediaStore.MediaColumns.DURATION) / 1000.toDouble()).toInt()
|
val videoDuration = Math.round(cursor.getIntValue(MediaStore.MediaColumns.DURATION) / 1000.toDouble()).toInt()
|
||||||
|
|
||||||
|
@ -485,6 +485,10 @@ class MediaFetcher(val context: Context) {
|
||||||
else -> TYPE_IMAGES
|
else -> TYPE_IMAGES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dateTaken == 0L) {
|
||||||
|
dateTaken = lastModified
|
||||||
|
}
|
||||||
|
|
||||||
val isFavorite = favoritePaths.contains(path)
|
val isFavorite = favoritePaths.contains(path)
|
||||||
val medium =
|
val medium =
|
||||||
Medium(null, filename, path, path.getParentPath(), lastModified, dateTaken, size, type, videoDuration, isFavorite, 0L, mediaStoreId)
|
Medium(null, filename, path, path.getParentPath(), lastModified, dateTaken, size, type, videoDuration, isFavorite, 0L, mediaStoreId)
|
||||||
|
|
Loading…
Reference in a new issue