mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 23:43:31 +01:00
scrub: Use syspath in beet scrub (#1297)
This commit is contained in:
parent
465719a208
commit
313c3807aa
2 changed files with 6 additions and 4 deletions
|
|
@ -71,10 +71,11 @@ class ScrubPlugin(BeetsPlugin):
|
|||
# Get album art if we need to restore it.
|
||||
if opts.write:
|
||||
try:
|
||||
mf = mediafile.MediaFile(item.path,
|
||||
mf = mediafile.MediaFile(util.syspath(item.path),
|
||||
config['id3v23'].get(bool))
|
||||
except IOError as exc:
|
||||
self._log.error(u'scrubbing failed: {0}', exc)
|
||||
self._log.error(u'could not open file to scrub: {0}',
|
||||
exc)
|
||||
art = mf.art
|
||||
|
||||
# Remove all tags.
|
||||
|
|
@ -86,7 +87,7 @@ class ScrubPlugin(BeetsPlugin):
|
|||
item.try_write()
|
||||
if art:
|
||||
self._log.info(u'restoring art')
|
||||
mf = mediafile.MediaFile(item.path)
|
||||
mf = mediafile.MediaFile(util.syspath(item.path))
|
||||
mf.art = art
|
||||
mf.save()
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@ Fixes:
|
|||
* :doc:`/plugins/embedart`: Fix a crash that occured when used together
|
||||
with the *check* plugin. :bug:`1241`
|
||||
* :doc:`/plugins/scrub`: Log an error instead of stopping when the ``beet
|
||||
scrub`` command cannot write a file. :bug:`1297`
|
||||
scrub`` command cannot write a file. Also, avoid problems on Windows with
|
||||
Unicode filenames. :bug:`1297`
|
||||
|
||||
For developers:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue