From ed8bcdc0e69de68fdf5ad82377e8e7fb8ecd3d78 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:30:13 -0800 Subject: [PATCH] make taglib work again??? --- scanner/metadata/taglib/taglib_test.go | 3 +-- scanner/metadata/taglib/taglib_wrapper.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scanner/metadata/taglib/taglib_test.go b/scanner/metadata/taglib/taglib_test.go index a7ac55021..1b88d9149 100644 --- a/scanner/metadata/taglib/taglib_test.go +++ b/scanner/metadata/taglib/taglib_test.go @@ -40,8 +40,7 @@ var _ = Describe("Extractor", func() { Expect(m).To(HaveKeyWithValue("album", []string{"Album", "Album"})) Expect(m).To(HaveKeyWithValue("artist", []string{"Artist", "Artist"})) Expect(m).To(HaveKeyWithValue("albumartist", []string{"Album Artist"})) - // Taglib is doing something silly now... this is commented out - // Expect(m).To(HaveKeyWithValue("compilation", []string{"1"})) // Compilation + Expect(m).To(HaveKeyWithValue("compilation", []string{"1"})) // Compilation Expect(m).To(HaveKeyWithValue("genre", []string{"Rock"})) Expect(m).To(HaveKeyWithValue("date", []string{"2014-05-21", "2014"})) Expect(m).To(HaveKeyWithValue("originaldate", []string{"1996-11-21"})) diff --git a/scanner/metadata/taglib/taglib_wrapper.cpp b/scanner/metadata/taglib/taglib_wrapper.cpp index 08ff57ca9..ee66b0d17 100644 --- a/scanner/metadata/taglib/taglib_wrapper.cpp +++ b/scanner/metadata/taglib/taglib_wrapper.cpp @@ -91,9 +91,10 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) { // with many players, so they will not be parsed if (id3Tags != NULL) { + const auto &frames = id3Tags->frameListMap(); bool hasLyrics = false; - const auto usltList = id3Tags->frameList("USLT"); + const auto usltList = frames["USLT"]; if (!usltList.isEmpty()) { for (const auto &tag: usltList) { TagLib::ID3v2::UnsynchronizedLyricsFrame *frame = dynamic_cast(tag); @@ -115,7 +116,7 @@ int taglib_read(const FILENAME_CHAR_T *filename, unsigned long id) { } } - const auto syltList = id3Tags->frameList("SYLT"); + const auto syltList = frames["SYLT"]; if (!syltList.isEmpty()) { for (const auto &tag: syltList) {