BeetsPlugin#
- class beets.plugins.BeetsPlugin(name: str | None = None)[source]#
Bases:
objectThe base class for all beets plugins. Plugins provide functionality by defining a subclass of BeetsPlugin and overriding the abstract methods defined here.
Public methods summary
add_media_field(name, descriptor)Add a field that is synchronized between media files and items.
commands()Should return a list of beets.ui.Subcommand objects for commands that should be added to beets' CLI.
Return a list of functions that should be called as importer pipelines stages early in the pipeline.
Return a list of functions that should be called as importer pipelines stages.
queries()Return a dict mapping prefixes to Query subclasses.
register_listener(event, func)Add a function as a listener for the specified event.
template_field(name)Decorator that registers a path template field computation.
template_func(name)Decorator that registers a path template function.
Methods definition
- commands() Sequence[Subcommand][source]#
Should return a list of beets.ui.Subcommand objects for commands that should be added to beets’ CLI.
- get_early_import_stages() list[ImportStageFunc][source]#
Return a list of functions that should be called as importer pipelines stages early in the pipeline.
The callables are wrapped versions of the functions in self.early_import_stages. Wrapping provides some bookkeeping for the plugin: specifically, the logging level is adjusted to WARNING.
- get_import_stages() list[ImportStageFunc][source]#
Return a list of functions that should be called as importer pipelines stages.
The callables are wrapped versions of the functions in self.import_stages. Wrapping provides some bookkeeping for the plugin: specifically, the logging level is adjusted to WARNING.
- add_media_field(name: str, descriptor: MediaField) None[source]#
Add a field that is synchronized between media files and items.
When a media field is added
item.write()will set the name property of the item’s MediaFile toitem[name]and save the changes. Similarlyitem.read()will setitem[name]to the value of the name property of the media file.
- register_listener(event: EventType, func: Listener) None[source]#
Add a function as a listener for the specified event.