s = sorted(s, key=operator.itemgetter(0), reverse=reverse)
songs = [track[-1] for track in s]
return songs
This will allow you to change the sort order on each column, but maintain the previous order for all rows that have the same value. For example, if you want to group all your albums together by artist and keep the track order, you would click track, then album, and then artist.
To fix this, edit exaile/ xl/gui/ playlist. py.
Add a line to 'import operator'
Then edit reorder_songs(self, songs) to read as follows:
def reorder_songs(self, songs):
"""
Resorts all songs
"""
attr, reverse = self.get_sort_by()
def the_strip(tag): library. the_cutter( tag)) lstrip_ special( tag)
return spec_strip(
def spec_strip(tag):
return library.
if attr in ('album', 'title'): getattr( track, attr).lower()) track.artist. lower() ) duration( )
get_key = lambda track: spec_strip(
elif attr == 'artist':
get_key = lambda track: the_strip(
elif attr == 'length':
get_key = lambda track: track.get_
else:
get_key = lambda track: getattr(track, attr)
s = [
(get_ key(track) ,
track)
for track in songs]
s = sorted(s, key=operator. itemgetter( 0), reverse=reverse)
songs = [track[-1] for track in s]
return songs
This will allow you to change the sort order on each column, but maintain the previous order for all rows that have the same value. For example, if you want to group all your albums together by artist and keep the track order, you would click track, then album, and then artist.