diff options
author | Max Kellermann <max@duempel.org> | 2014-01-22 22:04:04 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-22 23:10:00 +0100 |
commit | d9926a1c216a561361798bcc90ce0d7134df983e (patch) | |
tree | bfb9d7810272c8f0c94e7ffb2e8e5f651d82391f /src | |
parent | e50969e31ccfafe48e17f0fc094e4b48a4e0d886 (diff) | |
download | mpd-d9926a1c216a561361798bcc90ce0d7134df983e.tar.gz mpd-d9926a1c216a561361798bcc90ce0d7134df983e.tar.xz mpd-d9926a1c216a561361798bcc90ce0d7134df983e.zip |
db/upnp: use PathTraitsUTF8::Build()
Diffstat (limited to 'src')
-rw-r--r-- | src/db/UpnpDatabasePlugin.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx index 844a061c8..baea8cb38 100644 --- a/src/db/UpnpDatabasePlugin.cxx +++ b/src/db/UpnpDatabasePlugin.cxx @@ -36,6 +36,7 @@ #include "tag/TagTable.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" +#include "fs/Traits.hxx" #include "Log.hxx" #include "SongFilter.hxx" @@ -451,9 +452,16 @@ UpnpDatabase::BuildPath(ContentDirectoryService &server, if (!ReadNode(server, pid, dirent, error)) return false; pid = dirent.m_pid.c_str(); - path = dirent.name + (path.empty()? "" : "/" + path); + + if (path.empty()) + path = dirent.name; + else + path = PathTraitsUTF8::Build(dirent.name.c_str(), + path.c_str()); } - path = std::string(server.getFriendlyName()) + "/" + path; + + path = PathTraitsUTF8::Build(server.getFriendlyName(), + path.c_str()); return true; } @@ -598,7 +606,8 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server, case UPnPDirObject::Type::CONTAINER: if (visit_directory) { - const std::string uri = selection.uri + "/" + dirent.name; + const std::string uri = PathTraitsUTF8::Build(selection.uri.c_str(), + dirent.name.c_str()); const LightDirectory d(uri.c_str(), 0); if (!visit_directory(d, error)) return false; @@ -617,8 +626,8 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server, std::string p; if (!selection.recursive) - p = selection.uri + "/" + - dirent.name; + p = PathTraitsUTF8::Build(selection.uri.c_str(), + dirent.name.c_str()); if (!visitSong(std::move(dirent), p.c_str(), |