diff options
author | Max Kellermann <max@musicpd.org> | 2018-10-22 18:19:04 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-10-22 18:20:29 +0200 |
commit | 66ab2de5785755594b300b933083a0e5892d05fc (patch) | |
tree | a0e1dfa192d357a3749acf53dfc04876fcfcf4ef /src/db/plugins/upnp | |
parent | e28d1e0f65fb47f452934bc5d70fdb40bdc4c62e (diff) | |
parent | db27bb76e280c69d70bc14f0b0161e89d496a3c8 (diff) |
Merge branch 'v0.20.x'
Diffstat (limited to 'src/db/plugins/upnp')
-rw-r--r-- | src/db/plugins/upnp/UpnpDatabasePlugin.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx index 9d6a64f04..01ae971aa 100644 --- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx +++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx @@ -97,9 +97,9 @@ public: VisitSong visit_song, VisitPlaylist visit_playlist) const override; - void VisitUniqueTags(const DatabaseSelection &selection, - TagType tag_type, TagMask group_mask, - VisitTag visit_tag) const override; + std::map<std::string, std::set<std::string>> CollectUniqueTags(const DatabaseSelection &selection, + TagType tag_type, + TagType group) const override; DatabaseStats GetStats(const DatabaseSelection &selection) const override; @@ -624,17 +624,15 @@ UpnpDatabase::Visit(const DatabaseSelection &selection, helper.Commit(); } -void -UpnpDatabase::VisitUniqueTags(const DatabaseSelection &selection, - TagType tag, gcc_unused TagMask group_mask, - VisitTag visit_tag) const +std::map<std::string, std::set<std::string>> +UpnpDatabase::CollectUniqueTags(const DatabaseSelection &selection, + TagType tag, TagType group) const { - // TODO: use group_mask + (void)group; // TODO: use group - if (!visit_tag) - return; + std::map<std::string, std::set<std::string>> result; + auto &values = result[std::string()]; - std::set<std::string> values; for (auto& server : discovery->GetDirectories()) { const auto dirbuf = SearchSongs(server, rootid, selection); @@ -650,11 +648,7 @@ UpnpDatabase::VisitUniqueTags(const DatabaseSelection &selection, } } - for (const auto& value : values) { - TagBuilder builder; - builder.AddItem(tag, value.c_str()); - visit_tag(builder.Commit()); - } + return result; } DatabaseStats |