Fix handling of dashed options in loadfile.

Add tests based on --sub-file. Also add a test for sub_add here.
This commit is contained in:
jaseg 2020-07-12 13:27:53 +02:00
parent 3ef4ecf765
commit c3eef35f59
3 changed files with 45 additions and 9 deletions

2
mpv.py
View file

@ -921,7 +921,7 @@ class MPV(object):
@staticmethod
def _encode_options(options):
return ','.join('{}={}'.format(str(key), str(val)) for key, val in options.items())
return ','.join('{}={}'.format(_py_to_mpv(str(key)), str(val)) for key, val in options.items())
def loadfile(self, filename, mode='replace', **options):
"""Mapped mpv loadfile command, see man mpv(1)."""