Fix #2339: scrub resets art type

We now use the richer `images` field instead of the more basic `art` field.
This commit is contained in:
Adrian Sampson 2016-12-29 13:30:17 -05:00
parent 413666a825
commit ac41b6d6e5
2 changed files with 5 additions and 3 deletions

View file

@ -123,7 +123,7 @@ class ScrubPlugin(BeetsPlugin):
self._log.error(u'could not open file to scrub: {0}',
exc)
return
art = mf.art
images = mf.images
# Remove all tags.
self._scrub(item.path)
@ -132,12 +132,12 @@ class ScrubPlugin(BeetsPlugin):
if restore:
self._log.debug(u'writing new tags after scrub')
item.try_write()
if art:
if images:
self._log.debug(u'restoring art')
try:
mf = mediafile.MediaFile(util.syspath(item.path),
config['id3v23'].get(bool))
mf.art = art
mf.images = images
mf.save()
except mediafile.UnreadableFileError as exc:
self._log.error(u'could not write tags: {0}', exc)

View file

@ -25,6 +25,8 @@ Fixes:
* :doc:`/plugins/bpd`: Fix a crash on non-ASCII MPD commands. :bug:`2332`
* :doc:`/plugins/scrub`: Avoid a crash when files cannot be read or written.
:bug:`2351`
* :doc:`/plugins/scrub`: The image type values on scrubbed files are preserved
instead of being reset to "other." :bug:`2339`
For plugin developers: new importer prompt choices (see :ref:`append_prompt_choices`), you can now provide new candidates for the user to consider.