Skip to content

Conversation

@Video-Nomad
Copy link
Contributor

@Video-Nomad Video-Nomad commented Oct 21, 2025

Added a dynamic label separator (and a placeholder for it {s}) that when used will be automatically stripped if it is anywhere but between valid and non-empty placeholders (like {artist})

This is useful when there's a part of the label missing.
Example (old): Label is {title} - {artist}. If the {artist} data is not there the label will end up looking like Media Title - .

With the dynamic placeholder this will be detected and stripped.
Example (new): Label is {title}{s}{artist} and separator is set to -. So now, if everything is fine and both title and artist are there you will get what you expect Media Title - Artist. But if the artist is missing you will just get Media Title.

Also works with any additional strings added in between or around the placeholders.
Example: [{title}{s}{artist}] will still produce a proper [Media Title] without the separator if the artist value is empty.

Changes:

  • Added dynamic label separator placeholder "{s}".
  • Added separator option to media widget.
  • Dynamic separator is auto-stripped from beginning and end of label.
  • Added tokenizer.py to media utils to process the label.
  • Refactored media widget label processing.
  • Updated docs to reflect the change

- Added dynamic label separator placeholder "{s}".
- Added separator option to media widget.
- Dynamic separator is auto-stripped from beginning and end of label.
- Refactored media widget label processing.
- Added tokenizer to clean up media label
- Will remove empty placeholders and separators that are not enclosed by
  placeholders.
@Video-Nomad Video-Nomad marked this pull request as ready for review October 22, 2025 09:06
@amnweb amnweb merged commit c97ef49 into amnweb:main Oct 23, 2025
2 of 4 checks passed
@Video-Nomad Video-Nomad deleted the feat/media-optional-separator branch October 23, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants