aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-22 23:48:47 +0100
committerMax Kellermann <max@duempel.org>2014-01-22 23:52:08 +0100
commitf703d4fc3e55f58ad4777f45e07e5784f0699c64 (patch)
tree7a3d7f260b046e977192dba361e96f9ad250bd5c
parent77c461fed7dde948f2a226611004f7739c104462 (diff)
downloadmpd-f703d4fc3e55f58ad4777f45e07e5784f0699c64.tar.gz
mpd-f703d4fc3e55f58ad4777f45e07e5784f0699c64.tar.xz
mpd-f703d4fc3e55f58ad4777f45e07e5784f0699c64.zip
db/upnp: call VisitDirectory on servers, even in recursive mode
Diffstat (limited to '')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index 70b39a4d3..47d2d0dd0 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -677,24 +677,20 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
if (!m_superdir->getDirServices(servers, error))
return false;
- if (!selection.recursive) {
- // If the path is empty and recursive is not set, synthetize a
- // pseudo-directory from the list of servers.
+ for (const auto &server : servers) {
if (visit_directory) {
- for (auto& server : servers) {
- const LightDirectory d(server.getFriendlyName(), 0);
- if (!visit_directory(d, error))
- return false;
- }
- }
- } else {
- // Recursive is set: visit each server
- for (auto& server : servers) {
- if (!VisitServer(server, vpath, selection,
- visit_directory, visit_song, visit_playlist, error))
+ const LightDirectory d(server.getFriendlyName(), 0);
+ if (!visit_directory(d, error))
return false;
}
+
+ if (selection.recursive &&
+ !VisitServer(server, vpath, selection,
+ visit_directory, visit_song, visit_playlist,
+ error))
+ return false;
}
+
return true;
}