Better handle tags when no role is set
This commit is contained in:
@@ -140,6 +140,7 @@ getPerformerArtists(const TagLib::PropertyMap& properties,
|
|||||||
PerformerContainer performers;
|
PerformerContainer performers;
|
||||||
|
|
||||||
// picard stores like this: (see https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#performer)
|
// picard stores like this: (see https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#performer)
|
||||||
|
// We may hit both styles for the same track
|
||||||
// PERFORMER: artist (role)
|
// PERFORMER: artist (role)
|
||||||
if (const std::vector<std::string> artistNames {getPropertyValuesFirstMatchAs<std::string>(properties, artistTagNames)}; !artistNames.empty())
|
if (const std::vector<std::string> artistNames {getPropertyValuesFirstMatchAs<std::string>(properties, artistTagNames)}; !artistNames.empty())
|
||||||
{
|
{
|
||||||
@@ -151,11 +152,9 @@ getPerformerArtists(const TagLib::PropertyMap& properties,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// PERFORMER:role (MP3)
|
// PERFORMER:role (MP3)
|
||||||
else
|
|
||||||
{
|
|
||||||
for (const auto& [key, values] : properties)
|
for (const auto& [key, values] : properties)
|
||||||
{
|
{
|
||||||
if (key.startsWith("PERFORMER"))
|
if (key.startsWith("PERFORMER:"))
|
||||||
{
|
{
|
||||||
std::string performerStr {key.to8Bit(true)};
|
std::string performerStr {key.to8Bit(true)};
|
||||||
std::string role;
|
std::string role;
|
||||||
@@ -169,7 +168,6 @@ getPerformerArtists(const TagLib::PropertyMap& properties,
|
|||||||
performers[role].push_back(Artist {value.to8Bit(true)});
|
performers[role].push_back(Artist {value.to8Bit(true)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return performers;
|
return performers;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user