mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-18 13:00:36 +01:00
make sure the directory thumbnail file exists
This commit is contained in:
parent
6ce9ea4b8d
commit
6976c35ee4
@ -38,7 +38,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||||||
val firstItem = curMedia.first()
|
val firstItem = curMedia.first()
|
||||||
val lastItem = curMedia.last()
|
val lastItem = curMedia.last()
|
||||||
val parentDir = if (hasOTG && firstItem.path.startsWith(OTG_PATH)) firstItem.path.getParentPath() else File(firstItem.path).parent
|
val parentDir = if (hasOTG && firstItem.path.startsWith(OTG_PATH)) firstItem.path.getParentPath() else File(firstItem.path).parent
|
||||||
var thumbnail = firstItem.path
|
var thumbnail = curMedia.firstOrNull { context.getDoesFilePathExist(it.path) }?.path ?: ""
|
||||||
if (thumbnail.startsWith(OTG_PATH)) {
|
if (thumbnail.startsWith(OTG_PATH)) {
|
||||||
thumbnail = thumbnail.getOTGPublicPath(context)
|
thumbnail = thumbnail.getOTGPublicPath(context)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user