mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
Merge pull request #4146 from kergoth/move-pluginload
This commit is contained in:
commit
b7d0ddf6a4
2 changed files with 13 additions and 11 deletions
|
|
@ -1129,7 +1129,6 @@ def _load_plugins(options, config):
|
|||
plugin_list = config['plugins'].as_str_seq()
|
||||
|
||||
plugins.load_plugins(plugin_list)
|
||||
plugins.send("pluginload")
|
||||
return plugins
|
||||
|
||||
|
||||
|
|
@ -1145,16 +1144,6 @@ def _setup(options, lib=None):
|
|||
|
||||
plugins = _load_plugins(options, config)
|
||||
|
||||
# Get the default subcommands.
|
||||
from beets.ui.commands import default_commands
|
||||
|
||||
subcommands = list(default_commands)
|
||||
subcommands.extend(plugins.commands())
|
||||
|
||||
if lib is None:
|
||||
lib = _open_library(config)
|
||||
plugins.send("library_opened", lib=lib)
|
||||
|
||||
# Add types and queries defined by plugins.
|
||||
plugin_types_album = plugins.types(library.Album)
|
||||
library.Album._types.update(plugin_types_album)
|
||||
|
|
@ -1166,6 +1155,18 @@ def _setup(options, lib=None):
|
|||
library.Item._queries.update(plugins.named_queries(library.Item))
|
||||
library.Album._queries.update(plugins.named_queries(library.Album))
|
||||
|
||||
plugins.send("pluginload")
|
||||
|
||||
# Get the default subcommands.
|
||||
from beets.ui.commands import default_commands
|
||||
|
||||
subcommands = list(default_commands)
|
||||
subcommands.extend(plugins.commands())
|
||||
|
||||
if lib is None:
|
||||
lib = _open_library(config)
|
||||
plugins.send("library_opened", lib=lib)
|
||||
|
||||
return subcommands, plugins, lib
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ For plugin developers:
|
|||
|
||||
* :py:meth:`beets.library.Item.destination` now accepts a `replacements`
|
||||
argument to be used in favor of the default.
|
||||
* Send the `pluginload` event after plugin types and queries are available, not before.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue