aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/DatabasePrint.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/DatabasePrint.cxx
parent22206512539aa9a888fdba68d60324c560389d5d (diff)
downloadmpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.tar.gz
mpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.tar.xz
mpd-ae178c77bdc47c954fd9a4b32ffc07fe6c4a8a49.zip
DatabaseCommands: "list" allows grouping
Diffstat (limited to 'src/db/DatabasePrint.cxx')
-rw-r--r--src/db/DatabasePrint.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/db/DatabasePrint.cxx b/src/db/DatabasePrint.cxx
index 781866272..d84c26590 100644
--- a/src/db/DatabasePrint.cxx
+++ b/src/db/DatabasePrint.cxx
@@ -238,14 +238,24 @@ PrintSongURIVisitor(Client &client, const LightSong &song)
static bool
PrintUniqueTag(Client &client, TagType tag_type,
- const char *value)
+ const Tag &tag)
{
+ const char *value = tag.GetValue(tag_type);
+ assert(value != nullptr);
client_printf(client, "%s: %s\n", tag_item_names[tag_type], value);
+
+ for (unsigned i = 0, n = tag.num_items; i < n; i++) {
+ const TagItem &item = *tag.items[i];
+ if (item.type != tag_type)
+ client_printf(client, "%s: %s\n",
+ tag_item_names[item.type], item.value);
+ }
+
return true;
}
bool
-listAllUniqueTags(Client &client, unsigned type,
+listAllUniqueTags(Client &client, unsigned type, uint32_t group_mask,
const SongFilter *filter,
Error &error)
{
@@ -267,6 +277,7 @@ listAllUniqueTags(Client &client, unsigned type,
const auto f = std::bind(PrintUniqueTag, std::ref(client),
(TagType)type, _1);
return db->VisitUniqueTags(selection, (TagType)type,
+ group_mask,
f, error);
}
}