Commit 0340b013 authored by Max Kellermann's avatar Max Kellermann

db/Count: use ApplyTagFallback()

parent 94aed92e
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "client/Response.hxx" #include "client/Response.hxx"
#include "LightSong.hxx" #include "LightSong.hxx"
#include "tag/Tag.hxx" #include "tag/Tag.hxx"
#include "tag/Fallback.hxx"
#include <functional> #include <functional>
#include <map> #include <map>
...@@ -98,9 +99,9 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song) ...@@ -98,9 +99,9 @@ GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song)
assert(song.tag != nullptr); assert(song.tag != nullptr);
const Tag &tag = *song.tag; const Tag &tag = *song.tag;
if (!CollectGroupCounts(map, group, tag) && group == TAG_ALBUM_ARTIST) ApplyTagWithFallback(group,
/* fall back to "Artist" if no "AlbumArtist" was found */ std::bind(CollectGroupCounts, std::ref(map),
CollectGroupCounts(map, TAG_ARTIST, tag); std::placeholders::_1, std::cref(tag)));
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment