Skip to content

Commit 54f4ccb

Browse files
authored
Merge pull request #4155 from beetbox/album_removed_event
2 parents ca1974f + 9c9f7eb commit 54f4ccb

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

beets/library.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,9 @@ def remove(self, delete=False, with_items=True):
11421142
"""
11431143
super().remove()
11441144

1145+
# Send a 'album_removed' signal to plugins
1146+
plugins.send('album_removed', album=self)
1147+
11451148
# Delete art file.
11461149
if delete:
11471150
artpath = self.artpath

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Other new things:
5151
yes`` in your configuration to enable.
5252
* :doc:`/plugins/fetchart`: A new option to change cover art format. Useful for
5353
DAPs that do not support some image formats.
54+
* New plugin event: ``album_removed``. Called when an album is removed from the
55+
library (even when its file is not deleted from disk).
5456

5557
For plugin developers:
5658

docs/dev/plugins.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ The events currently available are:
143143
command finishes adding an album to the library. Parameters: ``lib``,
144144
``album``
145145

146+
* `album_removed`: called with an ``Album`` object every time an album is
147+
removed from the library (even when its file is not deleted from disk).
148+
146149
* `item_copied`: called with an ``Item`` object whenever its file is copied.
147150
Parameters: ``item``, ``source`` path, ``destination`` path
148151

0 commit comments

Comments
 (0)