show portrait folders in some cases

This commit is contained in:
tibbi 2019-10-01 10:41:51 +02:00
parent 7db3b82ae0
commit 3bdca11698
2 changed files with 6 additions and 3 deletions

View file

@ -62,7 +62,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.17.19'
implementation 'com.simplemobiletools:commons:5.18.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -1119,8 +1119,11 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
if (!File(it.path).exists()) {
invalidDirs.add(it)
} else if (it.path != config.tempFolderPath) {
val children = File(it.path).list()?.asList()
val hasMediaFile = children?.any { it?.isMediaFile() == true } ?: false
val children = File(it.path).listFiles()?.asList()
val hasMediaFile = children?.any {
it?.isMediaFile() == true || (it.isDirectory && it.name.startsWith("img_", true))
} ?: false
if (!hasMediaFile) {
invalidDirs.add(it)
}