File update-taglib-interface.patch of Package deepin-music-player
From d7d357b51bbfc8b0b4345d90859777475b97a745 Mon Sep 17 00:00:00 2001
From: Hillwood Yang <hillwood@opensuse.org>
Date: Thu, 10 Jul 2025 20:31:58 +0800
Subject: [PATCH] fix: Update taglib interface to 1.11
Log: Fix build on taglib 1.11
---
src/libdmusic/core/audioanalysis.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/libdmusic/core/audioanalysis.cpp b/src/libdmusic/core/audioanalysis.cpp
index d60fab219..8984edf48 100644
--- a/src/libdmusic/core/audioanalysis.cpp
+++ b/src/libdmusic/core/audioanalysis.cpp
@@ -206,9 +206,15 @@ bool AudioAnalysis::parseFileTagCodec(DMusic::MediaMeta &meta)
qCDebug(dmMusic) << "Audio length detected:" << meta.length << "ms for file:" << meta.localPath;
bool encode = true;
+#if TAGLIB_MAJOR_VERSION > 1 || (TAGLIB_MAJOR_VERSION == 1 && TAGLIB_MINOR_VERSION >= 11)
+ encode &= tag->title().isEmpty() ? true : tag->title().isLatin1();
+ encode &= tag->artist().isEmpty() ? true : tag->artist().isLatin1();
+ encode &= tag->album().isEmpty() ? true : tag->album().isLatin1();
+#else
encode &= tag->title().isNull() ? true : tag->title().isLatin1();
encode &= tag->artist().isNull() ? true : tag->artist().isLatin1();
encode &= tag->album().isNull() ? true : tag->album().isLatin1();
+#endif
if (encode) {
qCDebug(dmMusic) << "Tag contains Latin1 encoded data, detecting encoding for file:" << meta.localPath;
if (detectCodec.isEmpty()) {