fix bug where $args would be included in the command output if $args was

set in config but -A or --args was left off the beet play command.
This commit is contained in:
xarph 2016-07-26 15:41:45 -07:00
parent 327bebbd23
commit 9fb763e151
2 changed files with 9 additions and 0 deletions

View file

@ -90,6 +90,9 @@ class PlayPlugin(BeetsPlugin):
command_str = command_str.replace(ARGS_MARKER, opts.args)
else:
command_str = u"{} {}".format(command_str, opts.args)
else:
if ARGS_MARKER in command_str:
command_str = command_str.replace(" "+ARGS_MARKER, "")
# Perform search by album and add folders rather than tracks to
# playlist.

View file

@ -67,6 +67,12 @@ class PlayPluginTest(unittest.TestCase, TestHelper):
self.run_and_assert(
open_mock, [u'-A', u'foo', u'title:aNiceTitle'], u'echo foo other')
def test_unset_args_option_in_middle(self, open_mock):
self.config['play']['command'] = 'echo $args other'
self.run_and_assert(
open_mock, [u'title:aNiceTitle'], u'echo other')
def test_relative_to(self, open_mock):
self.config['play']['command'] = 'echo'
self.config['play']['relative_to'] = '/something'