From 4bc5333995528d2d9f4d8ad39f820a5b96fac178 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Oct 2018 10:06:04 +0200 Subject: tag/Set: use TagBuilder::AddItemUnchecked() This improves the workaround from commit b5ba94f1de06c621da937241eedfcfb100f26a09 and actually gives a useful result for "list" with a disabled tag. --- src/tag/Set.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/tag') diff --git a/src/tag/Set.cxx b/src/tag/Set.cxx index 34e823c89..81e9eb9b6 100644 --- a/src/tag/Set.cxx +++ b/src/tag/Set.cxx @@ -20,6 +20,7 @@ #include "Set.hxx" #include "TagBuilder.hxx" #include "Settings.hxx" +#include "util/StringView.hxx" #include @@ -70,10 +71,7 @@ TagSet::InsertUnique(const Tag &src, TagType type, const char *value, tag_mask_t group_mask) noexcept { TagBuilder builder; - if (value == nullptr) - builder.AddEmptyItem(type); - else - builder.AddItem(type, value); + builder.AddItemUnchecked(type, value); CopyTagMask(builder, src, group_mask); #if CLANG_OR_GCC_VERSION(4,8) emplace(builder.Commit()); @@ -110,8 +108,7 @@ TagSet::InsertUnique(const Tag &tag, if (!CheckUnique(type, tag, type, group_mask) && (type != TAG_ALBUM_ARTIST || - !IsTagEnabled(TAG_ALBUM_ARTIST) || /* fall back to "Artist" if no "AlbumArtist" was found */ !CheckUnique(type, tag, TAG_ARTIST, group_mask))) - InsertUnique(tag, type, nullptr, group_mask); + InsertUnique(tag, type, "", group_mask); } -- cgit v1.2.3