Skip to content

Commit

Permalink
Fix issue when searching by release group ID where total album tracks…
Browse files Browse the repository at this point in the history
… were being ignored
  • Loading branch information
kbuffington committed May 17, 2020
1 parent f7e694e commit 068f4e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit 068f4e9

Please sign in to comment.