From 53cefa328e8f50db9ec83ec5af6a927561ad1fa6 Mon Sep 17 00:00:00 2001 From: mried Date: Wed, 18 Feb 2015 19:06:58 +0100 Subject: [PATCH] Changed the path format from unicode to bytes. --- beetsplug/embedart.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beetsplug/embedart.py b/beetsplug/embedart.py index f567e0d2c..19e9a145d 100644 --- a/beetsplug/embedart.py +++ b/beetsplug/embedart.py @@ -26,7 +26,7 @@ from beets.plugins import BeetsPlugin from beets import mediafile from beets import ui from beets.ui import decargs -from beets.util import syspath, normpath, displayable_path +from beets.util import syspath, normpath, displayable_path, bytestring_path from beets.util.artresizer import ArtResizer from beets import config @@ -101,14 +101,14 @@ class EmbedCoverArtPlugin(BeetsPlugin): self.extract_first(normpath(opts.outpath), lib.items(decargs(args))) else: - filename = opts.filename or config['art_filename'].get() + filename = bytestring_path(opts.filename or + config['art_filename'].get()) if os.path.dirname(filename) != '': self._log.error(u"Only specify a name rather than a path " u"for -n") return for album in lib.albums(decargs(args)): - albumpath = album.path.decode('utf-8') - artpath = normpath(os.path.join(albumpath, filename)) + artpath = normpath(os.path.join(album.path, filename)) artpath = self.extract_first(artpath, album.items()) if artpath and opts.associate: album.set_art(artpath) @@ -266,7 +266,7 @@ class EmbedCoverArtPlugin(BeetsPlugin): self._log.warning(u'Unknown image type in {0}.', displayable_path(item.path)) return - outpath = outpath.decode('utf-8') + '.' + ext + outpath = outpath + b'.' + ext self._log.info(u'Extracting album art from: {0} to: {1}', item, displayable_path(outpath))