[gnome-music/wip/jfelder/gtk4-v3] coremodel: Sort songs incrementally
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/gtk4-v3] coremodel: Sort songs incrementally
- Date: Tue, 15 Feb 2022 11:14:28 +0000 (UTC)
commit bfc46a1c56584cd7e0b88e640b4bc50929f381a8
Author: Marinus Schraal <mschraal gnome org>
Date: Tue Feb 15 12:10:11 2022 +0100
coremodel: Sort songs incrementally
Incremental sort should be a smoother experience.
Add ordering to the Tracker query to help the sorter.
gnomemusic/coremodel.py | 1 +
gnomemusic/grilowrappers/grltrackerwrapper.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index e8720be26..97a930405 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -97,6 +97,7 @@ class CoreModel(GObject.GObject):
self._songs_model = Gtk.SortListModel.new(self._flatten_songs_model)
sorter = Gtk.CustomSorter()
sorter.set_sort_func(self._songs_sort)
+ self._songs_model.props.incremental = True
self._songs_model.set_sorter(sorter)
self._albums_model_proxy: Gio.ListStore = Gio.ListStore.new(
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 111c24c3a..a72963a3f 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -456,7 +456,7 @@ class GrlTrackerWrapper(GObject.GObject):
?urn nao:hasTag ?tag .
FILTER (?tag = nao:predefined-tag-favorite)
}}
- }}
+ }} ORDER BY ?title ?artist
""".split())
return query
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]