mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 23:43:31 +01:00
Merge pull request #493 from silb/item_copied_event
Send a plugin event when a file is copied.
This commit is contained in:
commit
95b2221f2c
2 changed files with 5 additions and 0 deletions
|
|
@ -350,6 +350,8 @@ class Item(LibModel):
|
|||
dest = util.unique_path(dest)
|
||||
if copy:
|
||||
util.copy(self.path, dest)
|
||||
plugins.send("item_copied", item=self, source=self.path,
|
||||
destination=dest)
|
||||
else:
|
||||
util.move(self.path, dest)
|
||||
plugins.send("item_moved", item=self, source=self.path,
|
||||
|
|
|
|||
|
|
@ -124,6 +124,9 @@ currently available are:
|
|||
command finishes adding an album to the library. Parameters: ``lib``,
|
||||
``album``
|
||||
|
||||
* *item_copied*: called with an ``Item`` object whenever its file is copied.
|
||||
Parameters: ``item``, ``source`` path, ``destination`` path
|
||||
|
||||
* *item_imported*: called with an ``Item`` object every time the importer adds a
|
||||
singleton to the library (not called for full-album imports). Parameters:
|
||||
``lib``, ``item``
|
||||
|
|
|
|||
Loading…
Reference in a new issue