[gnome-music/wip/mschraal/core: 24/70] coresong: poc sort
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/core: 24/70] coresong: poc sort
- Date: Tue, 18 Jun 2019 15:56:19 +0000 (UTC)
commit de40b92041c45430cae9c0fbb614d248be93c23b
Author: Marinus Schraal <mschraal gnome org>
Date: Wed May 8 22:58:44 2019 +0200
coresong: poc sort
gnomemusic/coremodel.py | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index c25f6f7d..2e3234fa 100644
--- a/gnomemusic/coremodel.py
+++ b/gnomemusic/coremodel.py
@@ -25,9 +25,14 @@ class CoreModel(GObject.GObject):
store = Gio.ListStore()
album_id = media.get_id()
+ def _reverse_sort(song_a, song_b):
+ return song_b.props.track_number - song_a.props.track_number
+
def _callback(source, dunno, media, something, something2):
if media is None:
+ store.sort(_reverse_sort)
return
+
print("media", media)
song = self._hash[media.get_id()]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]