Allow importing multiple playlist at once (#3752)

This commit is contained in:
wiiznokes 2023-05-11 15:37:10 +02:00 committed by GitHub
parent d76dcf12b2
commit 9183be810e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,8 +62,8 @@ class BackupRestoreSettings : BasePreferenceFragment() {
/**
* result listeners for importing and exporting playlists
*/
private val getPlaylistsFile = registerForActivityResult(ActivityResultContracts.GetContent()) {
it?.let {
private val getPlaylistsFile = registerForActivityResult(ActivityResultContracts.OpenMultipleDocuments()) {
it?.forEach {
CoroutineScope(Dispatchers.IO).launch {
ImportHelper.importPlaylists(requireActivity(), it)
}
@ -94,7 +94,7 @@ class BackupRestoreSettings : BasePreferenceFragment() {
val importPlaylists = findPreference<Preference>("import_playlists")
importPlaylists?.setOnPreferenceClickListener {
getPlaylistsFile.launch("*/*")
getPlaylistsFile.launch(arrayOf("*/*"))
true
}