db/Count: print empty group if song without grouped tag exists
Be consistent with "list" responses.
This commit is contained in:
@@ -90,10 +90,10 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
|
||||
assert(song.tag != nullptr);
|
||||
|
||||
const Tag &tag = *song.tag;
|
||||
VisitTagWithFallback(tag, group,
|
||||
std::bind(CollectGroupCounts, std::ref(map),
|
||||
std::cref(tag),
|
||||
std::placeholders::_1));
|
||||
VisitTagWithFallbackOrEmpty(tag, group,
|
||||
std::bind(CollectGroupCounts, std::ref(map),
|
||||
std::cref(tag),
|
||||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -49,4 +49,12 @@ VisitTagWithFallback(const Tag &tag, TagType type, F &&f) noexcept
|
||||
});
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
void
|
||||
VisitTagWithFallbackOrEmpty(const Tag &tag, TagType type, F &&f) noexcept
|
||||
{
|
||||
if (!VisitTagWithFallback(tag, type, f))
|
||||
f("");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user