From 1457dec99042ef25a65b404a1ee145e882c98621 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 15 Jun 2022 23:50:15 +0200 Subject: [PATCH] Map "popularity meter" of ID3v2 tags to the generic rating field See https://github.com/Martchus/tageditor/issues/84 --- CMakeLists.txt | 2 +- id3/id3v2frameids.cpp | 4 ++++ id3/id3v2tag.cpp | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4506f11..2ed92e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}") set(META_APP_DESCRIPTION "C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags") set(META_VERSION_MAJOR 11) set(META_VERSION_MINOR 2) -set(META_VERSION_PATCH 1) +set(META_VERSION_PATCH 2) set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0) set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) diff --git a/id3/id3v2frameids.cpp b/id3/id3v2frameids.cpp index 7790580..463b9bd 100644 --- a/id3/id3v2frameids.cpp +++ b/id3/id3v2frameids.cpp @@ -79,6 +79,8 @@ std::uint32_t convertToShortId(std::uint32_t id) return sRemixedBy; case lCopyright: return sCopyright; + case lRating: + return sRating; case lISRC: return sISRC; default: @@ -145,6 +147,8 @@ std::uint32_t convertToLongId(std::uint32_t id) return lRemixedBy; case sCopyright: return lCopyright; + case sRating: + return lRating; case sISRC: return lISRC; default: diff --git a/id3/id3v2tag.cpp b/id3/id3v2tag.cpp index 8dd651b..629c029 100644 --- a/id3/id3v2tag.cpp +++ b/id3/id3v2tag.cpp @@ -307,6 +307,8 @@ KnownField Id3v2Tag::internallyGetKnownField(const IdentifierType &id) const return KnownField::OriginalReleaseDate; case lMood: return KnownField::Mood; + case lRating: + return KnownField::Rating; case lISRC: return KnownField::ISRC; case sAlbum: @@ -349,6 +351,8 @@ KnownField Id3v2Tag::internallyGetKnownField(const IdentifierType &id) const return KnownField::RemixedBy; case sCopyright: return KnownField::Copyright; + case sRating: + return KnownField::Rating; case sISRC: return KnownField::ISRC; default: