mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
adding some default medium at creating directories from files
This commit is contained in:
parent
37a04d300b
commit
d8e0e87cb1
1 changed files with 3 additions and 2 deletions
|
@ -797,8 +797,9 @@ fun Context.createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val firstItem = curMedia.first()
|
val defaultMedium = Medium(0, "", "", "", 0L, 0L, 0L, 0, 0, false, 0L)
|
||||||
val lastItem = curMedia.last()
|
val firstItem = curMedia.firstOrNull() ?: defaultMedium
|
||||||
|
val lastItem = curMedia.lastOrNull() ?: defaultMedium
|
||||||
val dirName = checkAppendingHidden(path, hiddenString, includedFolders)
|
val dirName = checkAppendingHidden(path, hiddenString, includedFolders)
|
||||||
val lastModified = if (isSortingAscending) Math.min(firstItem.modified, lastItem.modified) else Math.max(firstItem.modified, lastItem.modified)
|
val lastModified = if (isSortingAscending) Math.min(firstItem.modified, lastItem.modified) else Math.max(firstItem.modified, lastItem.modified)
|
||||||
val dateTaken = if (isSortingAscending) Math.min(firstItem.taken, lastItem.taken) else Math.max(firstItem.taken, lastItem.taken)
|
val dateTaken = if (isSortingAscending) Math.min(firstItem.taken, lastItem.taken) else Math.max(firstItem.taken, lastItem.taken)
|
||||||
|
|
Loading…
Reference in a new issue