Draw a separator between albums with the same name, but a different artist

This commit is contained in:
Andrzej Rybczak
2020-12-21 18:58:48 +01:00
parent 88025e2e93
commit 89ebfbf73d
2 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
* Fix crash on startup with Visualizer as the initial screen.
* Fix crash on startup with Browser as the initial screen.
* Show the Visualizer immediately if it's the initial screen.
* Draw a separator between albums with the same name, but a different artist.
# ncmpcpp-0.9 (2020-12-20)
* Fix various Mopidy specific bugs.

View File

@@ -88,8 +88,14 @@ void setProperties(NC::Menu<T> &menu, const MPD::Song &s, const SongList &list,
auto next = list.beginS() + drawn_pos + 1;
if (next != list.endS())
{
if (next->song() != nullptr && next->song()->getAlbum() != s.getAlbum())
separate_albums = true;
if (next->song() != nullptr)
{
// Draw a separator when the next album is different than the current
// one. In case there are two albums with the same name, but a different
// artist, compare also artists.
separate_albums = next->song()->getAlbum() != s.getAlbum()
|| next->song()->getArtist() != s.getArtist();
}
}
}
if (separate_albums)