Skip to content

Commit

Permalink
Merge pull request #1565 from nathdwek/clearart-notify
Browse files Browse the repository at this point in the history
Rewrite the clearart method in order to send write events to the plugins.
  • Loading branch information
sampsyo committed Aug 24, 2015
2 parents a000a15 + 8bf60ee commit 9749d9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 1 addition & 11 deletions beets/art.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from beets.util import displayable_path, syspath
from beets.util.artresizer import ArtResizer
from beets import mediafile
from beets import config


def mediafile_image(image_path, maxwidth=None):
Expand Down Expand Up @@ -191,17 +190,8 @@ def extract_first(log, outpath, items):


def clear(log, lib, query):
id3v23 = config['id3v23'].get(bool)

items = lib.items(query)
log.info(u'Clearing album art from {0} items', len(items))
for item in items:
log.debug(u'Clearing art for {0}', item)
try:
mf = mediafile.MediaFile(syspath(item.path), id3v23)
except mediafile.UnreadableFileError as exc:
log.warning(u'Could not read file {0}: {1}',
displayable_path(item.path), exc)
else:
del mf.art
mf.save()
item.try_write(tags={'images': None})
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Fixes:

* :doc:`/plugins/lastgenre`: Fix a bug that prevented tag popularity from
being considered. Thanks to :user:`svoos`. :bug:`1559`
* Fixed a bug where plugins wouldn't be notified of the deletion of an item's
art, for example with the ``clearart`` command from the
:doc:`/plugins/embedart`. Thanks to :user:`nathdwek`. :bug:`1565`


1.3.14 (August 2, 2015)
Expand Down

0 comments on commit 9749d9f

Please sign in to comment.