From 40bed2db21dd3b5031546fbc8c3885d9bd00db22 Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Thu, 14 Nov 2024 23:28:32 +0100 Subject: [PATCH] Match file viewer playlist recursivity with settings --- .../hardcore/droidfs/file_viewers/FileViewerActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/FileViewerActivity.kt b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/FileViewerActivity.kt index 4522a77..60d74f9 100644 --- a/app/src/main/java/sushi/hardcore/droidfs/file_viewers/FileViewerActivity.kt +++ b/app/src/main/java/sushi/hardcore/droidfs/file_viewers/FileViewerActivity.kt @@ -137,7 +137,11 @@ abstract class FileViewerActivity: BaseActivity() { return } 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) } val sortOrder = intent.getStringExtra("sortOrder") ?: "name"