From 068f4e9db334df443ba8bf5851eeab36b9bc1a6c Mon Sep 17 00:00:00 2001 From: "kbuffington@gmail.com" Date: Sat, 16 May 2020 23:50:50 -0500 Subject: [PATCH] Fix issue when searching by release group ID where total album tracks were being ignored --- src/helpers.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers.cpp b/src/helpers.cpp index fda0d38..c70ed92 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -221,15 +221,22 @@ namespace mb else { json medias = release.value("media", json::array()); + size_t total_tracks = 0; + bool added = false; for (auto& media : medias) { size_t track_count = media.value("track-count", 0U); + total_tracks += track_count; if (track_count == count) { out.add_item(id); + added = true; break; } } + if (!added && total_tracks == count) { + out.add_item(id); + } } } }