Skip to content

Commit

Permalink
Fixed build with taglib < 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Jan 18, 2025
1 parent c7db5fc commit 5cfbbec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libs/metadata/impl/TagLibTagReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#include "core/String.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
Expand Down Expand Up @@ -322,14 +326,18 @@ namespace lms::metadata
{
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)
#endif
_hasEmbeddedCover = true;
}

// Taglib does not expose rtng in properties
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)
#endif
_propertyMap["ITUNESADVISORY"] = TagLib::String{ std::to_string(rtngItem.toByte()) };
}

Expand Down

0 comments on commit 5cfbbec

Please sign in to comment.