Skip to content

Commit

Permalink
play-raw: Rename the command target:
Browse files Browse the repository at this point in the history
passed_to_command -> open_args
  • Loading branch information
nath@home committed Sep 1, 2015
1 parent 7ed742b commit b9bc06d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions beetsplug/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ def play_music(self, lib, opts, args):

ui.print_(u'Playing {0} {1}.'.format(len(selection), item_type))
if raw:
passed_to_command = paths
open_args = paths
else:
passed_to_command = self._create_tmp_playlist(paths)
open_args = self._create_tmp_playlist(paths)

self._log.debug('executing command: {} {}', command_str,
b'"' + b' '.join(passed_to_command) + b'"')
b'"' + b' '.join(open_args) + b'"')
try:
util.interactive_open(passed_to_command, command_str)
util.interactive_open(open_args, command_str)
except OSError as exc:
raise ui.UserError("Could not play the music playlist: "
"{0}".format(exc))
finally:
if not raw:
self._log.debug('Removing temporary playlist: {}',
passed_to_command[0])
util.remove(passed_to_command[0])
open_args[0])
util.remove(open_args[0])

def _create_tmp_playlist(self, paths_list):
# Create temporary m3u file to hold our playlist.
Expand Down

0 comments on commit b9bc06d

Please sign in to comment.