[kupfer] plugin.rhythmbox: Fix track order sorting for Songs



commit c64ff372dddedbeed272fa654fa9f5871f4754b3
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Aug 18 23:25:41 2009 +0200

    plugin.rhythmbox: Fix track order sorting for Songs

 kupfer/plugin/rhythmbox.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/plugin/rhythmbox.py b/kupfer/plugin/rhythmbox.py
index 4f0fd5d..0df694c 100644
--- a/kupfer/plugin/rhythmbox.py
+++ b/kupfer/plugin/rhythmbox.py
@@ -308,7 +308,10 @@ class RhythmboxArtistsSource (Source):
 		yield ArtistLeaf
 
 def _locale_sort_artist_album_songs(artists):
-	"""Sort by Artist, then Album, then Track"""
+	"""Sort dictionary @artists by Artist, then Album,
+	each artist in @artists should already contain songs
+	grouped by album and sorted by track number.
+	"""
 	for artist in utils.locale_sort(artists):
 		artist_songs = artists[artist]
 		albums = set(s["album"] for s in artist_songs)
@@ -317,7 +320,6 @@ def _locale_sort_artist_album_songs(artists):
 			for song in artist_songs:
 				if song["album"] == album:
 					album_songs.append(song)
-			album_songs.sort(key=lambda s: s.get("track-number", u""))
 			for song in album_songs:
 				yield song
 



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