aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/plugins/ProxyDatabasePlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-04-24 10:20:24 +0200
committerMax Kellermann <max@duempel.org>2014-04-24 11:38:49 +0200
commitae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49 (patch)
treefd96f595113e5044be4cf4b18f17c3a1fdbf3ff9 /src/db/plugins/ProxyDatabasePlugin.cxx
parent22206512539aa9a888fdba68d60324c560389d5d (diff)
downloadmpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.tar.gz
mpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.tar.xz
mpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.zip
DatabaseCommands: "list" allows grouping
Diffstat (limited to 'src/db/plugins/ProxyDatabasePlugin.cxx')
-rw-r--r--src/db/plugins/ProxyDatabasePlugin.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx
index 0ab25005a..a3cc640cf 100644
--- a/src/db/plugins/ProxyDatabasePlugin.cxx
+++ b/src/db/plugins/ProxyDatabasePlugin.cxx
@@ -112,8 +112,8 @@ public:
Error &error) const override;
virtual bool VisitUniqueTags(const DatabaseSelection &selection,
- TagType tag_type,
- VisitString visit_string,
+ TagType tag_type, uint32_t group_mask,
+ VisitTag visit_tag,
Error &error) const override;
virtual bool GetStats(const DatabaseSelection &selection,
@@ -715,7 +715,8 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
bool
ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
TagType tag_type,
- VisitString visit_string,
+ gcc_unused uint32_t group_mask,
+ VisitTag visit_tag,
Error &error) const
{
// TODO: eliminate the const_cast
@@ -734,6 +735,8 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
if (!SendConstraints(connection, selection))
return CheckError(connection, error);
+ // TODO: use group_mask
+
if (!mpd_search_commit(connection))
return CheckError(connection, error);
@@ -742,7 +745,9 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
struct mpd_pair *pair;
while (result &&
(pair = mpd_recv_pair_tag(connection, tag_type2)) != nullptr) {
- result = visit_string(pair->value, error);
+ TagBuilder tag;
+ tag.AddItem(tag_type, pair->value);
+ result = visit_tag(tag.Commit(), error);
mpd_return_pair(connection, pair);
}