Skip to content

Commit

Permalink
Removed duplicate tags to mitigate issue spotted in #415
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Mar 2, 2024
1 parent ba180ea commit 1b2f309
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libs/metadata/impl/TagLibTagReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,15 @@ namespace MetaData
}
}

// Some users reported different tags being merges as multi-valued tags (see #415): try to make them unique
for (auto& [key, values] : _propertyMap)
{
// delete only adjacent entries, we don't want to lose order
auto it{ std::unique(std::begin(values), std::end(values)) };
while (it != std::end(values))
it = values.erase(it);
}

_hasMultiValuedTags = std::any_of(std::cbegin(_propertyMap), std::cend(_propertyMap), [](const auto& entry) { return entry.second.size() > 1; });
}

Expand Down

0 comments on commit 1b2f309

Please sign in to comment.