Match file viewer playlist recursivity with settings

This commit is contained in:
Matéo Duparc 2024-11-14 23:28:32 +01:00
parent f901495e41
commit 40bed2db21
Signed by: hardcoresushi
GPG Key ID: AFE384344A45E13A

View File

@ -137,7 +137,11 @@ abstract class FileViewerActivity: BaseActivity() {
return return
} }
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
encryptedVolume.recursiveMapFiles(originalParentPath)?.filterTo(playlist) { e -> if (sharedPrefs.getBoolean("map_folders", true)) {
encryptedVolume.recursiveMapFiles(originalParentPath)
} else {
encryptedVolume.readDir(originalParentPath)
}?.filterTo(playlist) { e ->
e.isRegularFile && (FileTypes.isExtensionType(getFileType(), e.name) || filePath == e.fullPath) e.isRegularFile && (FileTypes.isExtensionType(getFileType(), e.name) || filePath == e.fullPath)
} }
val sortOrder = intent.getStringExtra("sortOrder") ?: "name" val sortOrder = intent.getStringExtra("sortOrder") ?: "name"