Revert "musikr.fs: prototype arbitrary saf locations"

This reverts commit c730091637.
This commit is contained in:
Alexander Capehart
2026-01-17 08:52:38 -07:00
parent efd587d5ff
commit 8de7a125a8
7 changed files with 29 additions and 29 deletions
@@ -247,10 +247,10 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont
private fun String.toOpenedLocations(): List<Location.Opened> =
splitEscaped { it == ';' }
.mapNotNull { Location.Unopened.from(context, it.toUri()).open(context) }
.mapNotNull { Location.Unopened.from(context, it.toUri())?.open(context) }
private fun String.toUnopenedLocations(): List<Location.Unopened> =
splitEscaped { it == ';' }.map { Location.Unopened.from(context, it.toUri()) }
splitEscaped { it == ';' }.mapNotNull { Location.Unopened.from(context, it.toUri()) }
private inline fun String.splitEscaped(selector: (Char) -> Boolean): List<String> {
val split = mutableListOf<String>()
@@ -303,10 +303,11 @@ class LocationsDialog : ViewBindingMaterialDialogFragment<DialogMusicLocationsBi
val context = requireContext()
val location = Location.Unopened.from(context, uri)
if (location.path.volume == null) {
requireContext().showToast(R.string.err_weird_location)
if (location != null) {
pendingLocationCallback?.invoke(location)
} else {
requireContext().showToast(R.string.err_bad_location)
}
pendingLocationCallback?.invoke(location)
pendingLocationCallback = null
}
-1
View File
@@ -347,7 +347,6 @@
<string name="err_no_app">No app found that can handle this task</string>
<!-- No folders in the "Music Folders" setting -->
<string name="err_bad_location">This folder is not supported</string>
<string name="err_weird_location">Warning: This folder is managed by a 3rd-party</string>
<string name="lbl_no_folders">No folders</string>
<!-- Description Namespace | Accessibility Strings -->