diff --git a/core/common/src/main/java/dev/anilbeesetti/nextplayer/core/common/extensions/Context.kt b/core/common/src/main/java/dev/anilbeesetti/nextplayer/core/common/extensions/Context.kt index debac4746..d0aa34b12 100644 --- a/core/common/src/main/java/dev/anilbeesetti/nextplayer/core/common/extensions/Context.kt +++ b/core/common/src/main/java/dev/anilbeesetti/nextplayer/core/common/extensions/Context.kt @@ -245,6 +245,7 @@ suspend fun Context.convertToUTF8(uri: Uri, charset: Charset? = null): Uri = wit convertNetworkUriToUTF8(url = url, sourceCharset = detectedCharset) } } + else -> { val detectedCharset = charset ?: detectCharset(uri = uri, context = this@convertToUTF8) if (detectedCharset == StandardCharsets.UTF_8) { @@ -398,5 +399,10 @@ suspend fun ContentResolver.deleteMedia( } } -fun Context.getStorageVolumes() = getExternalFilesDirs(null) - .map { File(it.path.substringBefore("/Android")) } +fun Context.getStorageVolumes() = try { + getExternalFilesDirs(null)?.mapNotNull { + File(it.path.substringBefore("/Android")).takeIf { file -> file.exists() } + } ?: listOf(Environment.getExternalStorageDirectory()) +} catch (e: Exception) { + listOf(Environment.getExternalStorageDirectory()) +} diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 0fff48ace..e80969b59 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -204,4 +204,5 @@ Folders Tree Played progress + Media view mode \ No newline at end of file diff --git a/feature/videopicker/src/main/java/dev/anilbeesetti/nextplayer/feature/videopicker/composables/QuickSettingsDialog.kt b/feature/videopicker/src/main/java/dev/anilbeesetti/nextplayer/feature/videopicker/composables/QuickSettingsDialog.kt index c508667ae..9aaa034f2 100644 --- a/feature/videopicker/src/main/java/dev/anilbeesetti/nextplayer/feature/videopicker/composables/QuickSettingsDialog.kt +++ b/feature/videopicker/src/main/java/dev/anilbeesetti/nextplayer/feature/videopicker/composables/QuickSettingsDialog.kt @@ -67,7 +67,7 @@ fun QuickSettingsDialog( Column( modifier = Modifier.verticalScroll(rememberScrollState()), ) { - DialogSectionTitle(text = "Media view mode") + DialogSectionTitle(text = stringResource(R.string.media_view_mode)) SingleChoiceSegmentedButtonRow( modifier = Modifier.fillMaxWidth(), ) {