From c4d850825a4773b2d56526d7d1b208069ba49e12 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 19 Jun 2022 17:51:51 +0200 Subject: [PATCH] Map `RATING` field for Vorbis comments --- vorbis/vorbiscomment.cpp | 3 +++ vorbis/vorbiscommentids.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/vorbis/vorbiscomment.cpp b/vorbis/vorbiscomment.cpp index ded5d7d..da4f467 100644 --- a/vorbis/vorbiscomment.cpp +++ b/vorbis/vorbiscomment.cpp @@ -103,6 +103,8 @@ VorbisComment::IdentifierType VorbisComment::internallyGetFieldId(KnownField fie return std::string(director()); case KnownField::ISRC: return std::string(isrc()); + case KnownField::Rating: + return std::string(rating()); default: return std::string(); } @@ -140,6 +142,7 @@ KnownField VorbisComment::internallyGetKnownField(const IdentifierType &id) cons { license(), KnownField::License }, { director(), KnownField::Director }, { isrc(), KnownField::ISRC }, + { rating(), KnownField::Rating }, }); // clang-format on const auto knownField(fieldMap.find(id)); diff --git a/vorbis/vorbiscommentids.h b/vorbis/vorbiscommentids.h index 4abc1bf..2272a73 100644 --- a/vorbis/vorbiscommentids.h +++ b/vorbis/vorbiscommentids.h @@ -141,6 +141,10 @@ constexpr TAG_PARSER_EXPORT std::string_view isrc() { return "ISRC"; } +constexpr TAG_PARSER_EXPORT std::string_view rating() +{ + return "RATING"; +} constexpr TAG_PARSER_EXPORT std::string_view eanupn() { return "EAN/UPN";