mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
Merge pull request #489 from neomilium/master
events: add item_removed event
This commit is contained in:
commit
ec77d92cf9
2 changed files with 7 additions and 0 deletions
|
|
@ -712,6 +712,9 @@ class Item(Model):
|
|||
album = self.get_album()
|
||||
if album and not album.items():
|
||||
album.remove(delete, False)
|
||||
|
||||
# Send a 'item_removed' signal to plugins
|
||||
plugins.send('item_removed', item=self)
|
||||
|
||||
# Delete the associated file.
|
||||
if delete:
|
||||
|
|
|
|||
|
|
@ -131,6 +131,10 @@ currently available are:
|
|||
* *item_moved*: called with an ``Item`` object whenever its file is moved.
|
||||
Parameters: ``item``, ``source`` path, ``destination`` path
|
||||
|
||||
* *item_removed*: called with an ``Item`` object every time an item (singleton
|
||||
or album's part) is removed from the library (even when its file is not
|
||||
deleted from disk).
|
||||
|
||||
* *write*: called with an ``Item`` object just before a file's metadata is
|
||||
written to disk (i.e., just before the file on disk is opened).
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue