From 0c860c0fe99f2a9b18065e36a35cc46fad265da6 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 3 Dec 2023 15:56:45 -0500 Subject: [PATCH] Try to fall back to showing URI for storage location if concrete file path isn't available Closes #9977 --- .../presentation/more/settings/screen/SettingsDataScreen.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt index b1bd8879c..a4fb1b685 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt @@ -105,7 +105,8 @@ object SettingsDataScreen : SearchableSettings { return Preference.PreferenceItem.TextPreference( title = stringResource(MR.strings.pref_storage_location), subtitle = remember(storageDir) { - (UniFile.fromUri(context, storageDir.toUri())?.filePath) + val file = UniFile.fromUri(context, storageDir.toUri()) + file?.filePath ?: file?.uri?.toString() } ?: stringResource(MR.strings.invalid_location, storageDir), onClick = { try {