summaryrefslogtreecommitdiff
path: root/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/plugins/upnp/UpnpDatabasePlugin.cxx')
-rw-r--r--src/db/plugins/upnp/UpnpDatabasePlugin.cxx23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
index 89c5c7a02..6db9da940 100644
--- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx
@@ -27,6 +27,7 @@
#include "db/DatabasePlugin.hxx"
#include "db/Selection.hxx"
#include "db/VHelper.hxx"
+#include "db/UniqueTags.hxx"
#include "db/DatabaseError.hxx"
#include "db/LightDirectory.hxx"
#include "song/LightSong.hxx"
@@ -627,27 +628,7 @@ std::map<std::string, std::set<std::string>>
UpnpDatabase::CollectUniqueTags(const DatabaseSelection &selection,
TagType tag, TagType group) const
{
- (void)group; // TODO: use group
-
- std::map<std::string, std::set<std::string>> result;
- auto &values = result[std::string()];
-
- for (auto& server : discovery->GetDirectories()) {
- const auto dirbuf = SearchSongs(server, rootid, selection);
-
- for (const auto &dirent : dirbuf.objects) {
- if (dirent.type != UPnPDirObject::Type::ITEM ||
- dirent.item_class != UPnPDirObject::ItemClass::MUSIC)
- continue;
-
- const char *value = dirent.tag.GetValue(tag);
- if (value != nullptr) {
- values.emplace(value);
- }
- }
- }
-
- return result;
+ return ::CollectUniqueTags(*this, selection, tag, group);
}
DatabaseStats