Plugins
Plugins are written in Python, and are registered to the appropriate hooks. Each plugin has its own version identifier, but also lists the plugin API versions that it supports. When loading a plugin, Picard first compares its list of API versions to the plugin’s supported versions to ensure that the plugin will operate correctly. The Picard API versions indicate the version of the program in which the plugin API was last updated and any plugin APIs with which it is backwards compatible.
Hooks are connections to the various objects in Picard that call a specific type of plugin. During the normal running of Picard, when it encounters a hook it will first retrieve a list of all plugins registered for that specific hook, and then execute them sequentially in order based upon the priority specified when the plugin was registered to the hook.
There are a few different types of plugins, including:
Metadata processors: These plugins can access and modify the metadata when it is loaded from MusicBrainz. They are registered with register_album_metadata_processor() or register_track_metadata_processor(). These are what you might call “automatic” because they operate without any user intervention. An example is the Classical Extras plugin.
Cover art providers: These plugins provide another cover art source, and are registered with register_cover_art_provider(). They are also “automatic” in that they load album art without user intervention, although they must be enabled by the user in the Cover Art options. The Fanart.tv plugin is an example.
Cover art filters: These plugins can filter cover art images, either based on image metadata before download using register_cover_art_metadata_filter() or based on actual image content using register_cover_art_filter().
Cover art processors: These plugins can process and transform cover art images (e.g. resize, crop, or convert). They are registered with register_cover_art_processor().
Scripting functions: Some plugins provide additional scripting functions for use in or the renaming script. These are registered with register_script_function(). Keep tag, which provides the $keep() function, is an example.
Script variables: Plugins can register custom script variables that will be available for autocompletion in the scripting editor. These are registered with register_script_variable().
Context menu actions: Plugins can register actions that can be activated manually via the context menu. This is what the Load as non-album track plugin does. Another example is Generate Cuesheet. These are registered with register_album_action(), register_track_action(), register_file_action(), register_cluster_action() or register_clusterlist_action().
Tools menu actions: Plugins can add items to the Tools menu using register_tools_menu_action().
File formats: Plugins can provide support for new file formats not yet supported by Picard. These are registered with register_format().
Disc log readers: Plugins can add support for parsing additional disc ripper log formats. These are registered with register_disc_log_reader().
Options pages: Plugins can add custom pages to Picard’s options dialog for their own configuration settings. These are registered with register_options_page().
Event processors: Plugins can execute automatically based on certain event triggers. These are registered with register_file_post_load_processor(), register_file_pre_save_processor(), register_file_post_save_processor(), register_file_post_addition_to_track_processor(), register_file_post_removal_from_track_processor() or register_album_post_removal_processor().
Note that plugins are not limited to one of those areas. A single plugin could implement all of the above, but most existing plugins focus on one.
See also
For more information regarding the plugin system, please see the Picard Plugin V3 Documentation items in the Picard repository on GitHub. There is also a list of the available plugins that have been submitted to the MusicBrainz Picard repository shown on the Picard website.