diff --git a/beets/dbcore.py b/beets/dbcore.py index 2189c0c88..d40c0a80a 100644 --- a/beets/dbcore.py +++ b/beets/dbcore.py @@ -511,7 +511,6 @@ class Transaction(object): the row ID of the last affected row. """ cursor = self.lib._connection().execute(statement, subvals) - plugins.send('database_change', lib=self.lib) return cursor.lastrowid def script(self, statements): diff --git a/beets/library.py b/beets/library.py index ab2c8d383..ecc3218ee 100644 --- a/beets/library.py +++ b/beets/library.py @@ -204,6 +204,18 @@ class LibModel(dbcore.Model): funcs.update(plugins.template_funcs()) return funcs + def store(self): + super(LibModel, self).store() + plugins.send('database_change', lib=self.lib) + + def remove(self): + super(LibModel, self).remove() + plugins.send('database_change', lib=self.lib) + + def add(self, lib=None): + super(LibModel, self).add(lib) + plugins.send('database_change', lib=self.lib) + class Item(LibModel): _fields = ITEM_KEYS