Plugins¶
It’s pretty easy to write puddletag plugins provided you know a bit of Python. If anything’s unclear don’t hesitate mailing me (concentricpuddle@gmail.com) to complain. Follow the same protocol if you find any errors.
Required Info¶
puddletag plugins are stored in ~/.local/share/puddletag/plugins (or $XDG_DATA_HOME/puddletag/plugins). In order for a plugin to be registered the following tree structure is required.:
~/.local/share/puddletag/plugins
--\modulename
----\__init__.py
----\info
Plugins will be imported using modulename, as such only valid in Python module names (no spaces, periods, unicode, etc.) are allowed.
info is a INI file containing the plugin information. Use the following structure and keep in mind that all keys are case sensitive.
[info]
name = Plugin Name
author = Author Name
version = 1.0
puddletag_version = 0.9.3
description = Description of what the plugin has/does.
name: The name of the plugin as it’ll be displayed to a puddletag user.
author: Add the names of people responsible for this mofo.
version: The version number of your plugin.
puddletag_version: The version of puddletag this plugin was created with. May be used for backward compatibility if the plugin interface changes.
description: Add a short synopsis of what your plugin does.
Your plugin will not be loaded unless all this information is present. A plugin that can’t be loaded is left out, and the reason is listed in Messages (Help menu). A plugin whose init function fails stays loaded, and the error is listed in Messages (Help menu). A tag source of a plugin that can’t be started is left out too, and the reason is shown in the Tag Sources window and listed in Messages. To use a plugin, tick it on the Plugins page of Edit->Preferences, then restart puddletag. A step of an action that uses a function of a plugin that is off or didn’t load is kept: running the action skips it, and Messages names the plugin.
Plugins that come with puddletag¶
puddletag comes with these plugins. Tick one on the Plugins page of Edit->Preferences and restart puddletag to use it.
Extended Tags: the Extended Tags dialog as a tool window (Windows->Extended Tags). It shows the fields of the selected files; Plugins->Save Extended (Ctrl+Shift+S) writes your changes to them.
Highlight duplicate fields: Plugins->Dupe highlight asks for a field and colours every selected file that has the same value for it as another selected file. Click it again to remove the colours. Nothing is written to the files.
ID3 Tools: two commands in the Tag Tools menu, for the selected MP3 files. Update to ID3v2.4 saves their tags as ID3v2.4, whatever the ID3 version chosen on the Tags page of Edit->Preferences. Convert to UTF-8 saves every text field encoded as UTF-8, which only ID3v2.4 has, so the tag becomes ID3v2.4 too. Other files are left as they are. Neither works in Preview Mode.
Modtime + 2sec: Plugins->Add 2 seconds to modified time (Ctrl+M) adds two seconds to the selected files’ modification time, without touching their tags. It doesn’t work in Preview Mode.
Save tags: Plugins->Export tags saves the selected files’ tags, as the mutagen library reads them, to a file you choose (a Python pickle), to send along with a bug report.
View All Fields: Plugins->Show all fields replaces the columns with one per field the loaded files have, led by the fields listed on its page in Edit->Preferences (by default the filename and the folder). Click it again to get your columns back.
Plugin Examples:¶
The Function plugin example contains a short tutorial on writing scripting functions and Functions that can be part of an action.
The Tag Source Example contains a tag source that answers from its own list of albums, with comments on everything a tag source can do. Extract it into the plugins folder, tick Example Tag Source on the Plugins page of Edit->Preferences and restart puddletag to try it.