diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f43042..3560eb4 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 9) set(META_VERSION_MINOR 1) -set(META_VERSION_PATCH 0) +set(META_VERSION_PATCH 1) set(META_REQUIRED_CPP_UNIT_VERSION 1.14.0) set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) diff --git a/mp4/mp4tag.cpp b/mp4/mp4tag.cpp index 6597c9d..17ee397 100644 --- a/mp4/mp4tag.cpp +++ b/mp4/mp4tag.cpp @@ -163,6 +163,7 @@ Mp4Tag::IdentifierType Mp4Tag::internallyGetFieldId(KnownField field) const default: return 0; } + // do not forget to extend Mp4Tag::internallyGetKnownField() and Mp4TagField::appropriateRawDataType() as well } KnownField Mp4Tag::internallyGetKnownField(const IdentifierType &id) const @@ -213,6 +214,7 @@ KnownField Mp4Tag::internallyGetKnownField(const IdentifierType &id) const default: return KnownField::Invalid; } + // do not forget to extend Mp4Tag::internallyGetFieldId() and Mp4TagField::appropriateRawDataType() as well } bool Mp4Tag::setValue(KnownField field, const TagValue &value) diff --git a/mp4/mp4tagfield.cpp b/mp4/mp4tagfield.cpp index 8057661..2927c9c 100644 --- a/mp4/mp4tagfield.cpp +++ b/mp4/mp4tagfield.cpp @@ -350,9 +350,9 @@ std::vector Mp4TagField::expectedRawDataTypes() const /*! * \brief Returns an appropriate raw data type. * - * Returns the type info if assigned; otherwise returns - * an raw data type considered as appropriate for the ID - * of the field. + * Returns the type info if assigned; otherwise returns a raw data type considered as appropriate for + * the ID of the field. The latter is supposed to work for all supported tag fields IDs (those where a + * conversion to KnownField via Mp4Tag exists). */ std::uint32_t Mp4TagField::appropriateRawDataType() const { @@ -362,9 +362,9 @@ std::uint32_t Mp4TagField::appropriateRawDataType() const return typeInfo(); } - // there is no raw data type assigned (tag field was not - // present in original file but rather was added manually) - // try to derive appropriate raw data type from atom id + // there is no raw data type assigned (tag field was not present in original file and + // has been inserted by the library's user without type) + // -> try to derive appropriate raw data type from atom ID switch (id()) { case Album: case Artist: @@ -380,6 +380,7 @@ std::uint32_t Mp4TagField::appropriateRawDataType() const case RecordLabel: case Performers: case Lyricist: + case AlbumArtist: switch (value().dataEncoding()) { case TagTextEncoding::Utf8: return RawDataType::Utf8; @@ -419,6 +420,9 @@ std::uint32_t Mp4TagField::appropriateRawDataType() const break; default:; } + + // do not forget to extend Mp4Tag::internallyGetFieldId() and Mp4Tag::internallyGetKnownField() as well + throw Failure(); }