Commit bf8daf7d authored by Cédric Bellegarde's avatar Cédric Bellegarde

Fix #2544

parent 96cf71e3
Pipeline #214094 passed with stage
in 4 minutes and 40 seconds
......@@ -81,12 +81,17 @@ class GenresDatabase:
"""
orderby = App().settings.get_enum("orderby")
order = " ORDER BY genres.name, "
if orderby == OrderBy.ARTIST:
if orderby == OrderBy.ARTIST_YEAR:
order += " artists.sortname\
COLLATE NOCASE COLLATE LOCALIZED,\
albums.timestamp,\
albums.name\
COLLATE NOCASE COLLATE LOCALIZED"
elif orderby == OrderBy.ARTIST_TITLE:
order += " artists.sortname\
COLLATE NOCASE COLLATE LOCALIZED,\
albums.name\
COLLATE NOCASE COLLATE LOCALIZED"
elif orderby == OrderBy.NAME:
order += " albums.name\
COLLATE NOCASE COLLATE LOCALIZED"
......
......@@ -174,7 +174,16 @@ class AlbumsBoxView(FlowBoxView, SignalsHelper):
@param child2 as AlbumSimpleWidget
"""
orderby = App().settings.get_enum("orderby")
if orderby == OrderBy.ARTIST:
if orderby == OrderBy.ARTIST_YEAR:
artists1 = "".join(child1.data.artists)
artists2 = "".join(child2.data.artists)
if artists1 == artists2:
return child1.data.year is not None and\
child2.data.year is not None and\
child1.data.year > child2.data.year
else:
return artists1 > artists2
if orderby == OrderBy.ARTIST_LIST:
artists1 = "".join(child1.data.artists)
artists2 = "".join(child2.data.artists)
if artists1 == artists2:
......
......@@ -206,7 +206,7 @@ class RoundedArtistsViewWithBanner(RoundedArtistsView):
@param random as bool
"""
album_ids = App().albums.get_ids([], [], self.storage_type,
False, OrderBy.ARTIST)
False, OrderBy.ARTIST_YEAR)
if not album_ids:
return
albums = [Album(album_id) for album_id in album_ids]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment