mirror of
https://github.com/beetbox/beets.git
synced 2026-02-22 23:33:50 +01:00
don't attempt to string-format strings
This commit is contained in:
parent
04c0bd50fd
commit
55cea24b7b
1 changed files with 3 additions and 2 deletions
|
|
@ -198,8 +198,9 @@ def format_for_path(value, key=None):
|
|||
with _, etc. Doesn't guarantee that the whole path will be valid;
|
||||
you should still call `util.sanitize_path` on the complete path.
|
||||
"""
|
||||
if isinstance(value, str):
|
||||
value = value.decode('utf8', 'ignore')
|
||||
if isinstance(value, basestring):
|
||||
if isinstance(value, str):
|
||||
value = value.decode('utf8', 'ignore')
|
||||
elif key in ('track', 'tracktotal', 'disc', 'disctotal'):
|
||||
# Pad indices with zeros.
|
||||
value = u'%02i' % (value or 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue