mirror of
https://github.com/beetbox/beets.git
synced 2026-01-27 18:43:50 +01:00
move database_change events back to library.py
dbcore is abstractable. Should not depend on any beets internals.
This commit is contained in:
parent
c5b92919c6
commit
f46c8b0623
2 changed files with 12 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue