Plugin system #25

Open
opened 2025-10-18 12:41:14 +02:00 by robin-mu · 0 comments
robin-mu commented 2025-10-18 12:41:14 +02:00 (Migrated from github.com)

Plugins are files in a special folder. Each class is used when requested and can contain

  • a method to add metadata from other sources (e.g. local databases, idagio, musicbrainz). It is given the metadata table row of the current track and a copy of the current collection, and returns the requested field.
  • a method to modify the resulting file (e.g. cut it, add/modify tags). It is given the metadata table row of the current track, the Track object and a copy of the current collection and returns nothing, but can modify the Track in-place (e.g. if the filename changed).

Plugins can be requested in a formatting field (%(name)s) for metadata suggestions, or as a tag name in the tag settings. The syntax is [plugin]:[arg1],[arg2],...,[kwarg1_key]=[kwarg1_val],[kwarg2_key]=[kwarg2_val],.... The colon has to be present even if no arguments are given.

  • Metadata plugin collection: which can access collection settings
  • Metadata plugin ext_lyrics:[query] which downloads lyrics from external sources (with the syncedlyrics module) using the format string [query] as the search term.
  • Metadata plugin concat_playlist_timed:[format] to generate timed data from the individual videos of playlist-type urls which should be concatenated using their start time in the concatenated video and [format] as the timed text.
  • Metadata plugin tag:[name] to access the generated tag with the specified name. Since tag generation happens after metadata suggestion generation, this plugin might not work for metadata suggestions.
  • Tag plugin thumbnail:[name]: The file at this path/URL is embedded as image. mutagen's PictureType is used as possible values. If no name is set, the image will be embedded as front cover.
  • Tag plugin cut:: If this is set to a timed metadata field, chapters with special names will be used to cut the file or add silence
  • These two tag plugins should be executed directly during tag application (#21)
Plugins are files in a special folder. Each class is used when requested and can contain - a method to add metadata from other sources (e.g. local databases, idagio, musicbrainz). It is given the metadata table row of the current track and a copy of the current collection, and returns the requested field. - a method to modify the resulting file (e.g. cut it, add/modify tags). It is given the metadata table row of the current track, the `Track` object and a copy of the current collection and returns nothing, but can modify the `Track` in-place (e.g. if the filename changed). Plugins can be requested in a formatting field (`%(name)s`) for metadata suggestions, or as a tag name in the tag settings. The syntax is `[plugin]:[arg1],[arg2],...,[kwarg1_key]=[kwarg1_val],[kwarg2_key]=[kwarg2_val],...`. The colon has to be present even if no arguments are given. - [ ] Metadata plugin `collection:` which can access collection settings - [ ] Metadata plugin `ext_lyrics:[query]` which downloads lyrics from external sources (with the [syncedlyrics](https://pypi.org/project/syncedlyrics/) module) using the format string `[query]` as the search term. - [ ] Metadata plugin `concat_playlist_timed:[format]` to generate timed data from the individual videos of playlist-type urls which should be concatenated using their start time in the concatenated video and `[format]` as the timed text. - [ ] Metadata plugin `tag:[name]` to access the generated tag with the specified name. Since tag generation happens after metadata suggestion generation, this plugin might not work for metadata suggestions. - [ ] Tag plugin `thumbnail:[name]`: The file at this path/URL is embedded as image. mutagen's [PictureType](https://mutagen.readthedocs.io/en/latest/api/id3.html#mutagen.id3.PictureType) is used as possible values. If no name is set, the image will be embedded as front cover. - [ ] Tag plugin `cut:`: If this is set to a timed metadata field, chapters with special names will be used to cut the file or add silence - [ ] These two tag plugins should be executed directly during tag application (#21)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robin/MusicSync#25
No description provided.