musikr.playlist: tolerate 3rd-party paths
This commit is contained in:
@@ -93,7 +93,7 @@ private class ExternalPlaylistManagerImpl(
|
||||
private val m3u: M3U,
|
||||
) : ExternalPlaylistManager {
|
||||
override suspend fun import(uri: Uri): ImportedPlaylist? {
|
||||
val filePath = documentPathFactory.unpackDocumentUri(uri) ?: return null
|
||||
val filePath = documentPathFactory.unpackDocumentUri(uri) ?: Path(null, Components.root())
|
||||
|
||||
return try {
|
||||
context.contentResolverSafe.openInputStream(uri)?.use {
|
||||
@@ -118,7 +118,7 @@ private class ExternalPlaylistManagerImpl(
|
||||
}
|
||||
|
||||
override suspend fun export(playlist: Playlist, uri: Uri, config: ExportConfig): Boolean {
|
||||
val filePath = documentPathFactory.unpackDocumentUri(uri) ?: return false
|
||||
val filePath = documentPathFactory.unpackDocumentUri(uri) ?: Path(null, Components.root())
|
||||
val workingDirectory =
|
||||
if (config.absolute) {
|
||||
Path(filePath.volume, Components.parseUnix("/"))
|
||||
|
||||
Reference in New Issue
Block a user