Fix template validation error

Commit 9c72ebccd3 introduced a bug: all template strings are validated against the disc template RegEx (which, for example, is wrong if we're testing the track template).
This commit is contained in:
JoeLametta
2018-11-04 08:00:00 +00:00
parent f0fcae872d
commit 4f5b684ec7
3 changed files with 17 additions and 4 deletions

View File

@@ -196,10 +196,6 @@ class Program:
"""
assert isinstance(outdir, unicode), "%r is not unicode" % outdir
assert isinstance(template, unicode), "%r is not unicode" % template
matches = re.findall(r"%[^A,S,d,y,r,R,x,X]", template)
if '%' in template and matches:
raise ValueError('disc template string contains invalid '
'variable(s): {}.'.format(', '.join(matches)))
v = {}
v['A'] = 'Unknown Artist'
v['d'] = mbdiscid # fallback for title