Merge pull request #489 from neomilium/master

events: add item_removed event
This commit is contained in:
Adrian Sampson 2014-01-09 22:28:53 -08:00
commit ec77d92cf9
2 changed files with 7 additions and 0 deletions

View file

@ -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:

View file

@ -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).