Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the clearart method in order to send write events to the plugins. #1565

Merged
merged 4 commits into from
Aug 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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