Fixes a bug when trying to modify the artpath with special characters

Basically, it uses the helpers that handle conversion bytestring <-> unicode with the item's path, but weren't being used with artpath. For now, it just fixes the behavior for `modify`
This commit is contained in:
Lucas Duailibe 2013-05-27 02:06:27 -03:00
parent 29546fda5f
commit 87dedaafad
2 changed files with 8 additions and 0 deletions

View file

@ -381,6 +381,11 @@ def _colordiff(a, b, highlight='red'):
else:
return colorize(highlight, a), colorize(highlight, b)
if not isinstance(a, unicode) or not isinstance(b, unicode):
# This is probably a path
a = util.displayable_path(a)
b = util.displayable_path(b)
a_out = []
b_out = []

View file

@ -1107,6 +1107,9 @@ def modify_items(lib, mods, query, write, move, album, confirm):
key, value = mod.split('=', 1)
if key not in allowed_keys:
raise ui.UserError('"%s" is not a valid field' % key)
if key == 'artpath':
value = util.bytestring_path(value)
fsets[key] = _convert_type(key, value, album)
# Get the items to modify.