Fixed build with taglib < 2.0.1

This commit is contained in:
emeric
2025-01-18 14:45:31 +01:00
parent c7db5fc61a
commit 5cfbbeca65
@@ -48,6 +48,10 @@
#include "core/String.hpp" #include "core/String.hpp"
#include "metadata/Exception.hpp" #include "metadata/Exception.hpp"
#if (TAGLIB_MAJOR_VERSION > 2) || (TAGLIB_MAJOR_VERSION == 2 && TAGLIB_MINOR_VERSION > 0)
#define TAGLIB_HAS_MP4_ITEM_TYPE
#endif
namespace lms::metadata namespace lms::metadata
{ {
namespace namespace
@@ -322,14 +326,18 @@ namespace lms::metadata
{ {
if (const TagLib::MP4::Item coverItem{ mp4File->tag()->item("covr") }; coverItem.isValid()) if (const TagLib::MP4::Item coverItem{ mp4File->tag()->item("covr") }; coverItem.isValid())
{ {
#if TAGLIB_HAS_MP4_ITEM_TYPE
if (coverItem.type() == TagLib::MP4::Item::Type::CoverArtList) if (coverItem.type() == TagLib::MP4::Item::Type::CoverArtList)
#endif
_hasEmbeddedCover = true; _hasEmbeddedCover = true;
} }
// Taglib does not expose rtng in properties // Taglib does not expose rtng in properties
if (const TagLib::MP4::Item rtngItem{ mp4File->tag()->item("rtng") }; rtngItem.isValid()) if (const TagLib::MP4::Item rtngItem{ mp4File->tag()->item("rtng") }; rtngItem.isValid())
{ {
#if TAGLIB_HAS_MP4_ITEM_TYPE
if (rtngItem.type() == TagLib::MP4::Item::Type::Byte) if (rtngItem.type() == TagLib::MP4::Item::Type::Byte)
#endif
_propertyMap["ITUNESADVISORY"] = TagLib::String{ std::to_string(rtngItem.toByte()) }; _propertyMap["ITUNESADVISORY"] = TagLib::String{ std::to_string(rtngItem.toByte()) };
} }