diff --git a/beets/library.py b/beets/library.py index fe2892736..3458e35d3 100644 --- a/beets/library.py +++ b/beets/library.py @@ -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: diff --git a/docs/dev/plugins.rst b/docs/dev/plugins.rst index 6feb73326..e18fc1584 100644 --- a/docs/dev/plugins.rst +++ b/docs/dev/plugins.rst @@ -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).