mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 07:23:33 +01:00
Changed the path format from unicode to bytes.
This commit is contained in:
parent
b3fc489305
commit
53cefa328e
1 changed files with 5 additions and 5 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue