diff --git a/headphones/helpers.py b/headphones/helpers.py index c6089cfd..6437e2d1 100644 --- a/headphones/helpers.py +++ b/headphones/helpers.py @@ -177,10 +177,13 @@ def replace_all(text, dic, normalize=False): for i, j in dic.iteritems(): if normalize: - if sys.platform == 'darwin': - j = unicodedata.normalize('NFD', j) - else: - j = unicodedata.normalize('NFC', j) + try: + if sys.platform == 'darwin': + j = unicodedata.normalize('NFD', j) + else: + j = unicodedata.normalize('NFC', j) + except TypeError: + j = unicodedata.normalize('NFC', j.decode(headphones.SYS_ENCODING, 'replace')) text = text.replace(i, j) return text diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index a17c96b3..a1f0bcc7 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -629,10 +629,11 @@ def renameNFO(albumpath): logger.error(u'Could not rename file: %s. Error: %s' % (os.path.join(r, file).decode(headphones.SYS_ENCODING, 'replace'), e)) def moveFiles(albumpath, release, tracks): + logger.info("Moving files: %s" % albumpath) try: year = release['ReleaseDate'][:4] except TypeError: - year = '' + year = u'' artist = release['ArtistName'].replace('/', '_') album = release['AlbumTitle'].replace('/', '_')