From b1bca85ef4a8c9e596fb41f95417fe7042ab5a1b Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 29 Dec 2023 16:50:41 +0100 Subject: [PATCH] Support publisher webpage in Vorbis comments --- tag.h | 3 ++- vorbis/vorbiscomment.cpp | 3 +++ vorbis/vorbiscommentids.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tag.h b/tag.h index 5fe6c51..2625430 100644 --- a/tag.h +++ b/tag.h @@ -126,6 +126,7 @@ enum class KnownField : unsigned int { ProductionCopyright, /** production copyright */ License, /** license */ TermsOfUse, /** terms of use */ + PublisherWebpage, /** the publisher's official webpage */ }; /*! @@ -136,7 +137,7 @@ constexpr KnownField firstKnownField = KnownField::Title; /*! * \brief The last valid entry in the TagParser::KnownField enum. */ -constexpr KnownField lastKnownField = KnownField::TermsOfUse; +constexpr KnownField lastKnownField = KnownField::PublisherWebpage; /*! * \brief The number of valid entries in the TagParser::KnownField enum. diff --git a/vorbis/vorbiscomment.cpp b/vorbis/vorbiscomment.cpp index 68da913..2385a54 100644 --- a/vorbis/vorbiscomment.cpp +++ b/vorbis/vorbiscomment.cpp @@ -109,6 +109,8 @@ VorbisComment::IdentifierType VorbisComment::internallyGetFieldId(KnownField fie return std::string(bpm()); case KnownField::Publisher: return std::string(publisher()); + case KnownField::PublisherWebpage: + return std::string(publisherWebpage()); default: return std::string(); } @@ -149,6 +151,7 @@ KnownField VorbisComment::internallyGetKnownField(const IdentifierType &id) cons { rating(), KnownField::Rating }, { bpm(), KnownField::Bpm }, { publisher(), KnownField::Publisher }, + { publisherWebpage(), KnownField::PublisherWebpage }, }); // clang-format on const auto knownField(fieldMap.find(id)); diff --git a/vorbis/vorbiscommentids.h b/vorbis/vorbiscommentids.h index 40ec6d3..7f4d61b 100644 --- a/vorbis/vorbiscommentids.h +++ b/vorbis/vorbiscommentids.h @@ -189,6 +189,10 @@ constexpr TAG_PARSER_EXPORT std::string_view bpm() { return "BPM"; } +constexpr TAG_PARSER_EXPORT std::string_view publisherWebpage() +{ + return "WWWPUBLISHER"; +} } // namespace VorbisCommentIds