Preserve casing in field mapping consistently for cases where it is wanted
This commit is contained in:
parent
cea78543e0
commit
e8c0450c1c
|
@ -8,40 +8,37 @@ using namespace TagParser;
|
||||||
namespace Cli {
|
namespace Cli {
|
||||||
namespace FieldMapping {
|
namespace FieldMapping {
|
||||||
|
|
||||||
static constexpr struct {
|
static constexpr auto fieldMapping = std::array<Mapping, 99>{{
|
||||||
const char *knownDenotation;
|
{ "Title", KnownField::Title },
|
||||||
KnownField knownField;
|
{ "Album", KnownField::Album },
|
||||||
} fieldMapping[] = {
|
{ "Artist", KnownField::Artist },
|
||||||
{ "title", KnownField::Title },
|
{ "Genre", KnownField::Genre },
|
||||||
{ "album", KnownField::Album },
|
{ "Year", KnownField::RecordDate },
|
||||||
{ "artist", KnownField::Artist },
|
{ "Comment", KnownField::Comment },
|
||||||
{ "genre", KnownField::Genre },
|
{ "Bpm", KnownField::Bpm },
|
||||||
{ "year", KnownField::RecordDate },
|
{ "Bps", KnownField::Bps },
|
||||||
{ "comment", KnownField::Comment },
|
{ "Lyricist", KnownField::Lyricist },
|
||||||
{ "bpm", KnownField::Bpm },
|
{ "Track", KnownField::TrackPosition },
|
||||||
{ "bps", KnownField::Bps },
|
{ "Disk", KnownField::DiskPosition },
|
||||||
{ "lyricist", KnownField::Lyricist },
|
{ "Part", KnownField::PartNumber },
|
||||||
{ "track", KnownField::TrackPosition },
|
{ "TotalParts", KnownField::TotalParts },
|
||||||
{ "disk", KnownField::DiskPosition },
|
{ "Encoder", KnownField::Encoder },
|
||||||
{ "part", KnownField::PartNumber },
|
{ "RecordDate", KnownField::RecordDate },
|
||||||
{ "totalparts", KnownField::TotalParts },
|
{ "ReleaseDate", KnownField::ReleaseDate },
|
||||||
{ "encoder", KnownField::Encoder },
|
{ "Performers", KnownField::Performers },
|
||||||
{ "recorddate", KnownField::RecordDate },
|
{ "Duration", KnownField::Length },
|
||||||
{ "releasedate", KnownField::ReleaseDate },
|
{ "Language", KnownField::Language },
|
||||||
{ "performers", KnownField::Performers },
|
{ "EncoderSettings", KnownField::EncoderSettings },
|
||||||
{ "duration", KnownField::Length },
|
{ "Lyrics", KnownField::Lyrics },
|
||||||
{ "language", KnownField::Language },
|
{ "SynchronizedLyrics", KnownField::SynchronizedLyrics },
|
||||||
{ "encodersettings", KnownField::EncoderSettings },
|
{ "Grouping", KnownField::Grouping },
|
||||||
{ "lyrics", KnownField::Lyrics },
|
{ "RecordLabel", KnownField::RecordLabel },
|
||||||
{ "synchronizedlyrics", KnownField::SynchronizedLyrics },
|
{ "Cover", KnownField::Cover },
|
||||||
{ "grouping", KnownField::Grouping },
|
{ "Composer", KnownField::Composer },
|
||||||
{ "recordlabel", KnownField::RecordLabel },
|
{ "Rating", KnownField::Rating },
|
||||||
{ "cover", KnownField::Cover },
|
{ "Description", KnownField::Description },
|
||||||
{ "composer", KnownField::Composer },
|
{ "Vendor", KnownField::Vendor },
|
||||||
{ "rating", KnownField::Rating },
|
{ "AlbumArtist", KnownField::AlbumArtist },
|
||||||
{ "description", KnownField::Description },
|
|
||||||
{ "vendor", KnownField::Vendor },
|
|
||||||
{ "albumartist", KnownField::AlbumArtist },
|
|
||||||
{ "Subtitle", KnownField::Subtitle },
|
{ "Subtitle", KnownField::Subtitle },
|
||||||
{ "LeadPerformer", KnownField::LeadPerformer },
|
{ "LeadPerformer", KnownField::LeadPerformer },
|
||||||
{ "Arranger", KnownField::Arranger },
|
{ "Arranger", KnownField::Arranger },
|
||||||
|
@ -111,7 +108,7 @@ static constexpr struct {
|
||||||
{ "ProductionCopyright", KnownField::ProductionCopyright },
|
{ "ProductionCopyright", KnownField::ProductionCopyright },
|
||||||
{ "License", KnownField::License },
|
{ "License", KnownField::License },
|
||||||
{ "TermsOfUse", KnownField::TermsOfUse },
|
{ "TermsOfUse", KnownField::TermsOfUse },
|
||||||
};
|
}};
|
||||||
|
|
||||||
const char *fieldDenotation(TagParser::KnownField knownField)
|
const char *fieldDenotation(TagParser::KnownField knownField)
|
||||||
{
|
{
|
||||||
|
@ -145,5 +142,10 @@ TagParser::KnownField knownField(const char *fieldDenotation, std::size_t fieldD
|
||||||
return KnownField::Invalid;
|
return KnownField::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::array<Mapping, 99> &mapping()
|
||||||
|
{
|
||||||
|
return fieldMapping;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace FieldMapping
|
} // namespace FieldMapping
|
||||||
} // namespace Cli
|
} // namespace Cli
|
||||||
|
|
Loading…
Reference in New Issue