From c3e63084d2299920396d976604f7ae896e22be37 Mon Sep 17 00:00:00 2001 From: xarph Date: Sat, 26 Nov 2016 23:08:35 -0800 Subject: [PATCH] =?UTF-8?q?fix=20for=20unidecode=20converting=20=C2=A2=20i?= =?UTF-8?q?nto=20C/,=20ruining=20paths.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beets/library.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beets/library.py b/beets/library.py index e80c4da72..78155d2b2 100755 --- a/beets/library.py +++ b/beets/library.py @@ -824,7 +824,11 @@ class Item(LibModel): subpath = unicodedata.normalize('NFC', subpath) if beets.config['asciify_paths']: - subpath = unidecode(subpath) + path_components = subpath.split(os.path.sep) + sep_replace = beets.config['path_sep_replace'].get() + for index, item in enumerate(path_components): + path_components[index] = unidecode(item).replace(os.path.sep,sep_replace) + subpath = os.path.sep.join(path_components) maxlen = beets.config['max_filename_length'].get(int) if not maxlen: