diff options
author | Max Kellermann <max@duempel.org> | 2014-01-21 21:02:21 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-21 21:02:21 +0100 |
commit | ecac7a629eb0e407338593dd4c6cbd9d7e1bf257 (patch) | |
tree | 6fc5066bd58b88916ccfc56a50bc9fbc29815c10 | |
parent | 21209ff46bc4c5ffd43bf5abe1c8858ea2c9a721 (diff) |
db/upnp: fix empty song URI
Fall back to UPnPDirObject::url if there is no override.
-rw-r--r-- | src/db/UpnpDatabasePlugin.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index 0768488a3..a5ca07256 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -65,7 +65,10 @@ public: } UpnpSong(UPnPDirObject &&object, const char *_uri) - :uri2(_uri), tag2(std::move(object.tag)) { + :uri2(_uri == nullptr + ? std::move(object.url) + : std::string(_uri)), + tag2(std::move(object.tag)) { directory = nullptr; uri = uri2.c_str(); tag = &tag2; @@ -563,7 +566,7 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server, error)) return false; - if (!visitSong(std::move(dirent), "", selection, + if (!visitSong(std::move(dirent), nullptr, selection, visit_song, error)) return false; } @@ -594,7 +597,7 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server, switch (tdirent.item_class) { case UPnPDirObject::ItemClass::MUSIC: if (visit_song) - return visitSong(std::move(tdirent), "", + return visitSong(std::move(tdirent), nullptr, selection, visit_song, error); break; |