mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
typed import_stages
This commit is contained in:
parent
d7c1d7f1a1
commit
b3c61d5c19
1 changed files with 4 additions and 1 deletions
|
|
@ -44,6 +44,7 @@ if TYPE_CHECKING:
|
|||
|
||||
from beets.autotag import AlbumInfo, Distance, TrackInfo
|
||||
from beets.dbcore import Query
|
||||
from beets.importer import ImportSession, ImportTask
|
||||
from beets.library import Album, Item, Library
|
||||
from beets.ui import Subcommand
|
||||
|
||||
|
|
@ -96,6 +97,8 @@ class BeetsPlugin:
|
|||
|
||||
name: str
|
||||
config: ConfigView
|
||||
early_import_stages: list[Callable[[ImportSession, ImportTask], None]]
|
||||
import_stages: list[Callable[[ImportSession, ImportTask], None]]
|
||||
|
||||
def __init__(self, name: str | None = None):
|
||||
"""Perform one-time plugin setup."""
|
||||
|
|
@ -584,7 +587,7 @@ def send(event: str, **arguments: Any) -> list[Any]:
|
|||
Return a list of non-None values returned from the handlers.
|
||||
"""
|
||||
log.debug("Sending event: {0}", event)
|
||||
results = []
|
||||
results: list[Any] = []
|
||||
for handler in event_handlers()[event]:
|
||||
result = handler(**arguments)
|
||||
if result is not None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue