From a01b8f28af2546df9bce8a433dd4f0ca42079514 Mon Sep 17 00:00:00 2001 From: emeric Date: Thu, 25 Jun 2020 15:41:14 +0200 Subject: [PATCH] Better detection of embedded covers for vorbis/opus ogg files. ref #71 --- src/libs/metadata/impl/TagLibParser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libs/metadata/impl/TagLibParser.cpp b/src/libs/metadata/impl/TagLibParser.cpp index 5fa1bfea..2a83651a 100644 --- a/src/libs/metadata/impl/TagLibParser.cpp +++ b/src/libs/metadata/impl/TagLibParser.cpp @@ -26,8 +26,10 @@ #include #include #include +#include #include #include +#include #include #include "utils/Logger.hpp" @@ -399,6 +401,16 @@ TagLibParser::parse(const std::filesystem::path& p, bool debug) if (!flacFile->pictureList().isEmpty()) track.hasCover = true; } + else if (TagLib::Ogg::Vorbis::File* vorbisFile {dynamic_cast(f.file())}) + { + if (!vorbisFile->tag()->pictureList().isEmpty()) + track.hasCover = true; + } + else if (TagLib::Ogg::Opus::File* opusFile {dynamic_cast(f.file())}) + { + if (!opusFile->tag()->pictureList().isEmpty()) + track.hasCover = true; + } for (const auto& property : properties) {