From c9da7bf3f8b020c7cde5ebe894a92a6bc3cd7356 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 15 May 2012 12:33:57 -0700 Subject: [PATCH] new plugin event: import_task_choice --- beets/importer.py | 1 + docs/changelog.rst | 2 ++ docs/plugins/writing.rst | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/beets/importer.py b/beets/importer.py index 1438a1f26..0691985b6 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -605,6 +605,7 @@ def user_query(config): choice = config.choose_match_func(task, config) task.set_choice(choice) log_choice(config, task) + plugins.send('import_task_choice', task=task, config=config) # As-tracks: transition to singleton workflow. if choice is action.TRACKS: diff --git a/docs/changelog.rst b/docs/changelog.rst index 979093a94..104b8a0e4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,6 +4,8 @@ Changelog 1.0b15 (in development) ----------------------- +* New plugin event: ``import_task_choice`` is called after an import task has an + action assigned. 1.0b14 (May 12, 2012) --------------------- diff --git a/docs/plugins/writing.rst b/docs/plugins/writing.rst index be0a4d437..045bee557 100644 --- a/docs/plugins/writing.rst +++ b/docs/plugins/writing.rst @@ -137,6 +137,11 @@ currently available are: * *import_task_apply*: called after metadata changes have been applied in an import task. Parameters: ``task`` and ``config``. +* *import_task_choice*: called after a decision has been made about an import + task. This event can be used to initiate further interaction with the user. + Use ``task.choice_flag`` to determine the action to be taken. Parameters: + ``task`` and ``config``. + The included ``mpdupdate`` plugin provides an example use case for event listeners. Extend the Autotagger