summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-06-05 22:01:28 +0200
committerMax Kellermann <max@musicpd.org>2018-06-05 22:01:28 +0200
commit5217a74b7f018b69d8dbfeafc740a4b3105241e4 (patch)
tree2147b4868b4bb24b22f62bd3e10566baa83ac718 /src
parentcccf35d140e5d3525485bae4c1632b0e779be493 (diff)
storage/udisks: return file path in MapUTF8()
The absolute udisks:// URI is not usable with InputStream::Open(), and thus we need to return the LocalStorage::MapUTF8() return value instead.
Diffstat (limited to 'src')
-rw-r--r--src/storage/plugins/UdisksStorage.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/storage/plugins/UdisksStorage.cxx b/src/storage/plugins/UdisksStorage.cxx
index da1463da5..793781a7d 100644
--- a/src/storage/plugins/UdisksStorage.cxx
+++ b/src/storage/plugins/UdisksStorage.cxx
@@ -298,10 +298,18 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept
{
assert(uri_utf8 != nullptr);
- if (StringIsEmpty(uri_utf8))
- return base_uri;
+ try {
+ const_cast<UdisksStorage *>(this)->MountWait();
+
+ return mounted_storage->MapUTF8(uri_utf8);
+ } catch (...) {
+ /* fallback - not usable but the best we can do */
- return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8);
+ if (StringIsEmpty(uri_utf8))
+ return base_uri;
+
+ return PathTraitsUTF8::Build(base_uri.c_str(), uri_utf8);
+ }
}
const char *