Skip to content

Commit

Permalink
cdburn: reverse file order passed to xfburn. Fixes #2163
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Dec 27, 2016
1 parent 57273fe commit f59f4fe
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions quodlibet/quodlibet/ext/songsmenu/k3b.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@ class BurnCD(SongsMenuPlugin):
plugin_handles = each_song(is_a_file)

burn_programs = {
'K3b': ['k3b', '--audiocd'],
'Brasero': ['brasero', '--audio'],
'Xfburn': ['xfburn', '--audio-composition'],
# args, reverse order
'K3b': (['k3b', '--audiocd'], False),
'Brasero': (['brasero', '--audio'], False),
'Xfburn': (['xfburn', '--audio-composition'], True),
}

def __init__(self, *args, **kwargs):
super(BurnCD, self).__init__(*args, **kwargs)
self.prog_name = None

items = self.burn_programs.items()
progs = [(iscommand(x[1][0]), x) for x in items]
progs = [(iscommand(x[1][0][0]), x) for x in items]
progs.sort(reverse=True)

submenu = Gtk.Menu()
for (is_cmd, (name, (cmd, arg))) in progs:
for (is_cmd, (name, (args, reverse))) in progs:
item = Gtk.MenuItem(label=name)
if not is_cmd:
item.set_sensitive(False)
Expand All @@ -57,5 +58,6 @@ def plugin_songs(self, songs):
if self.prog_name is None:
return

cmd, arg = self.burn_programs[self.prog_name]
util.spawn([cmd, arg] + [song['~filename'] for song in songs])
args, reverse = self.burn_programs[self.prog_name]
songs = sorted(songs, key=lambda s: s.sort_key, reverse=reverse)
util.spawn(args + [song['~filename'] for song in songs])

0 comments on commit f59f4fe

Please sign in to comment.