mirror of
https://github.com/beetbox/beets.git
synced 2026-01-14 04:01:43 +01:00
Merge pull request #1565 from nathdwek/clearart-notify
Rewrite the clearart method in order to send write events to the plugins.
This commit is contained in:
commit
9749d9f134
2 changed files with 4 additions and 11 deletions
12
beets/art.py
12
beets/art.py
|
|
@ -25,7 +25,6 @@ import os
|
|||
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):
|
||||
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue