db/upnp: merge two PathTraitsUTF8::Build() calls
This commit is contained in:
parent
77070f5ab9
commit
c455d2c1de
@ -552,17 +552,6 @@ VisitItem(const UPnPDirObject &object, const char *uri,
|
|||||||
gcc_unreachable();
|
gcc_unreachable();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
VisitItem(const UPnPDirObject &object, const std::string &uri,
|
|
||||||
const DatabaseSelection &selection,
|
|
||||||
VisitSong visit_song, VisitPlaylist visit_playlist,
|
|
||||||
Error &error)
|
|
||||||
{
|
|
||||||
return VisitItem(object, uri.c_str(),
|
|
||||||
selection, visit_song, visit_playlist,
|
|
||||||
error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// vpath is a parsed and writeable version of selection.uri. There is
|
// vpath is a parsed and writeable version of selection.uri. There is
|
||||||
// really just one path parameter.
|
// really just one path parameter.
|
||||||
bool
|
bool
|
||||||
@ -632,6 +621,9 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto &dirent : dirbuf.objects) {
|
for (auto &dirent : dirbuf.objects) {
|
||||||
|
const std::string uri = PathTraitsUTF8::Build(base_uri,
|
||||||
|
dirent.name.c_str());
|
||||||
|
|
||||||
switch (dirent.type) {
|
switch (dirent.type) {
|
||||||
case UPnPDirObject::Type::UNKNOWN:
|
case UPnPDirObject::Type::UNKNOWN:
|
||||||
assert(false);
|
assert(false);
|
||||||
@ -639,8 +631,6 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
|
|||||||
|
|
||||||
case UPnPDirObject::Type::CONTAINER:
|
case UPnPDirObject::Type::CONTAINER:
|
||||||
if (visit_directory) {
|
if (visit_directory) {
|
||||||
const std::string uri = PathTraitsUTF8::Build(base_uri,
|
|
||||||
dirent.name.c_str());
|
|
||||||
const LightDirectory d(uri.c_str(), 0);
|
const LightDirectory d(uri.c_str(), 0);
|
||||||
if (!visit_directory(d, error))
|
if (!visit_directory(d, error))
|
||||||
return false;
|
return false;
|
||||||
@ -649,9 +639,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UPnPDirObject::Type::ITEM:
|
case UPnPDirObject::Type::ITEM:
|
||||||
if (!VisitItem(dirent,
|
if (!VisitItem(dirent, uri.c_str(),
|
||||||
PathTraitsUTF8::Build(base_uri,
|
|
||||||
dirent.name.c_str()),
|
|
||||||
selection,
|
selection,
|
||||||
visit_song, visit_playlist,
|
visit_song, visit_playlist,
|
||||||
error))
|
error))
|
||||||
|
Loading…
Reference in New Issue
Block a user