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,7 +1006,9 @@ 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 { parentDirs.firstOrNull { it.path == longestSharedPath }?.apply {
if (path.equals(child.path, true) || path.equals(File(child.path).parent, true) || children.any { it.path.equals(File(child.path).parent, true) }) {
subfoldersCount++ subfoldersCount++
if (path != child.path) { if (path != child.path) {
subfoldersMediaCount += child.mediaCnt subfoldersMediaCount += child.mediaCnt
@ -1014,6 +1016,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
} }
} }
} }
}
private fun createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>, albumCovers: ArrayList<AlbumCover>, hiddenString: String, private fun createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>, albumCovers: ArrayList<AlbumCover>, hiddenString: String,
includedFolders: MutableSet<String>, isSortingAscending: Boolean): Directory { includedFolders: MutableSet<String>, isSortingAscending: Boolean): Directory {