Remove unidecode for windows file names

This commit is contained in:
Ade
2017-10-22 09:43:55 +13:00
parent 0828643c09
commit f9d73da31b
2 changed files with 8 additions and 14 deletions

View File

@@ -22,7 +22,6 @@ import time
import sys
import tempfile
import glob
from unidecode import unidecode
from beets import logging as beetslogging
import six
@@ -225,11 +224,6 @@ def replace_illegal_chars(string, type="file"):
string = re.sub('[\?"*:|<>/]', '_', string)
if type == "folder":
string = re.sub('[:\?<>"|*]', '_', string)
# Asciify windows file/folder names
if sys.platform == "win32":
string = unidecode(string)
return string

View File

@@ -348,17 +348,17 @@ class WebInterface(object):
dirs = set(dirs)
for dir in dirs:
artistfolder = os.path.join(dir, folder)
if not os.path.isdir(artistfolder.encode(headphones.SYS_ENCODING)):
logger.debug("Cannot find directory: " + artistfolder)
continue
try:
try:
for dir in dirs:
artistfolder = os.path.join(dir, folder)
if not os.path.isdir(artistfolder.encode(headphones.SYS_ENCODING)):
logger.debug("Cannot find directory: " + artistfolder)
continue
threading.Thread(target=librarysync.libraryScan,
kwargs={"dir": artistfolder, "artistScan": True, "ArtistID": ArtistID,
"ArtistName": artist_name}).start()
except Exception as e:
logger.error('Unable to complete the scan: %s' % e)
except Exception as e:
logger.error('Unable to complete the scan: %s' % e)
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID)