summaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-10-22 18:19:04 +0200
committerMax Kellermann <max@musicpd.org>2018-10-22 18:20:29 +0200
commit66ab2de5785755594b300b933083a0e5892d05fc (patch)
treea0e1dfa192d357a3749acf53dfc04876fcfcf4ef /src/command
parente28d1e0f65fb47f452934bc5d70fdb40bdc4c62e (diff)
parentdb27bb76e280c69d70bc14f0b0161e89d496a3c8 (diff)
Merge branch 'v0.20.x'
Diffstat (limited to 'src/command')
-rw-r--r--src/command/DatabaseCommands.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx
index 09c2612b4..f95c5eb3f 100644
--- a/src/command/DatabaseCommands.cxx
+++ b/src/command/DatabaseCommands.cxx
@@ -267,7 +267,7 @@ handle_list(Client &client, Request args, Response &r)
}
std::unique_ptr<SongFilter> filter;
- TagMask group_mask = TagMask::None();
+ TagType group = TAG_NUM_OF_ITEM_TYPES;
if (args.size == 1) {
/* for compatibility with < 0.12.0 */
@@ -282,18 +282,16 @@ handle_list(Client &client, Request args, Response &r)
args.shift()));
}
- while (args.size >= 2 &&
- StringIsEqual(args[args.size - 2], "group")) {
+ if (args.size >= 2 &&
+ StringIsEqual(args[args.size - 2], "group")) {
const char *s = args[args.size - 1];
- TagType gt = tag_name_parse_i(s);
- if (gt == TAG_NUM_OF_ITEM_TYPES) {
+ group = tag_name_parse_i(s);
+ if (group == TAG_NUM_OF_ITEM_TYPES) {
r.FormatError(ACK_ERROR_ARG,
"Unknown tag type: %s", s);
return CommandResult::ERROR;
}
- group_mask |= gt;
-
args.pop_back();
args.pop_back();
}
@@ -310,13 +308,13 @@ handle_list(Client &client, Request args, Response &r)
filter->Optimize();
}
- if (group_mask.Test(tagType)) {
+ if (tagType < TAG_NUM_OF_ITEM_TYPES && tagType == group) {
r.Error(ACK_ERROR_ARG, "Conflicting group");
return CommandResult::ERROR;
}
PrintUniqueTags(r, client.GetPartition(),
- tagType, group_mask, filter.get());
+ tagType, group, filter.get());
return CommandResult::OK;
}