[gnome-music/wip/mschraal/core] coremodel: Better sort with casefold



commit b500ddb7748858cb9f2870108adc5e5789032982
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri Jun 28 20:56:55 2019 +0200

    coremodel: Better sort with casefold

 gnomemusic/coremodel.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index 634b626e..e182b7cc 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -75,10 +75,12 @@ class CoreModel(GObject.GObject):
         return coresong.props.selected
 
     def _albums_sort(self, album_a, album_b):
-        return album_b.props.title.lower() < album_a.props.title.lower()
+        return album_b.props.title.casefold() < album_a.props.title.casefold()
 
     def _artist_sort(self, artist_a, artist_b):
-        return artist_b.props.artist.lower() < artist_a.props.artist.lower()
+        name_a = artist_a.props.artist.casefold()
+        name_b = artist_b.props.artist.casefold()
+        return name_a > name_b
 
     @log
     def get_model(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]