diff --git a/beets/library.py b/beets/library.py index cbc1d6018..b57c51943 100644 --- a/beets/library.py +++ b/beets/library.py @@ -1002,7 +1002,7 @@ class Library(BaseLibrary): self.path = bytestring_path(normpath(path)) self.directory = bytestring_path(normpath(directory)) self.path_formats = path_formats - self.art_filename = bytestring_path(art_filename) + self.art_filename = art_filename self.replacements = replacements self._memotable = {} # Used for template substitution performance. @@ -1564,8 +1564,11 @@ class Album(BaseAlbum): """ image = bytestring_path(image) item_dir = item_dir or self.item_dir() + sanitized_art_filename = util.sanitize_for_path(self.evaluate_template(self._library.art_filename),os.path) _, ext = os.path.splitext(image) - dest = os.path.join(item_dir, self._library.art_filename + ext) + + dest = os.path.join(item_dir, util.sanitize_path(sanitized_art_filename) + ext) + return dest def set_art(self, path, copy=True):