add an extra check for handling only direct subfolders

This commit is contained in:
tibbi 2018-12-15 23:51:27 +01:00
parent 619e7ee3f4
commit a96e3201a3

View file

@ -1006,10 +1006,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
}
// make sure we count only the proper direct subfolders, grouped the same way as on the main screen
parentDirs.firstOrNull { it.path == longestSharedPath }?.apply {
subfoldersCount++
if (path != child.path) {
subfoldersMediaCount += child.mediaCnt
if (path.equals(child.path, true) || path.equals(File(child.path).parent, true) || children.any { it.path.equals(File(child.path).parent, true) }) {
subfoldersCount++
if (path != child.path) {
subfoldersMediaCount += child.mediaCnt
}
}
}
}