mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 11:32:30 +01:00
Add before_item_moved event
This event gets called just before `util.move` with the same arguments as the `item_moved` event.
This commit is contained in:
parent
6cc643520d
commit
a7c996d3af
2 changed files with 5 additions and 0 deletions
|
|
@ -397,6 +397,8 @@ class Item(LibModel):
|
|||
plugins.send("item_copied", item=self, source=self.path,
|
||||
destination=dest)
|
||||
else:
|
||||
plugins.send("before_item_moved", item=self, source=self.path,
|
||||
destination=dest)
|
||||
util.move(self.path, dest)
|
||||
plugins.send("item_moved", item=self, source=self.path,
|
||||
destination=dest)
|
||||
|
|
|
|||
|
|
@ -133,6 +133,9 @@ currently available are:
|
|||
singleton to the library (not called for full-album imports). Parameters:
|
||||
``lib``, ``item``
|
||||
|
||||
* *before_item_moved*: called with an ``Item`` object immediately before its
|
||||
file is moved. Parameters: ``item``, ``source`` path, ``destination`` path
|
||||
|
||||
* *item_moved*: called with an ``Item`` object whenever its file is moved.
|
||||
Parameters: ``item``, ``source`` path, ``destination`` path
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue