diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 6cd4bb7bd..06430c20d 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -731,6 +731,7 @@ def main(args=None, configfh=None): replacements) except sqlite3.OperationalError: raise UserError("database file %s could not be opened" % db_path) + plugins.send("library_opened", lib=lib) # Configure the logger. log = logging.getLogger('beets') diff --git a/docs/changelog.rst b/docs/changelog.rst index 104b8a0e4..7cef3e1a1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,6 +6,8 @@ Changelog * New plugin event: ``import_task_choice`` is called after an import task has an action assigned. +* New plugin event: ``library_opened`` is called when beets starts up and + opens the library database. 1.0b14 (May 12, 2012) --------------------- diff --git a/docs/plugins/writing.rst b/docs/plugins/writing.rst index 045bee557..f7115e76f 100644 --- a/docs/plugins/writing.rst +++ b/docs/plugins/writing.rst @@ -142,6 +142,9 @@ currently available are: Use ``task.choice_flag`` to determine the action to be taken. Parameters: ``task`` and ``config``. +* *library_opened*: called after beets starts up and initializes the main + Library object. Parameter: ``lib``. + The included ``mpdupdate`` plugin provides an example use case for event listeners. Extend the Autotagger