feat(media): dynamic label separator#515
Merged
amnweb merged 3 commits intoamnweb:mainfrom Oct 23, 2025
Merged
Conversation
- 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.
Kepners
pushed a commit
to Kepners/yasb
that referenced
this pull request
Feb 4, 2026
…parator feat(media): dynamic label separator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 likeMedia 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 expectMedia Title - Artist. But if the artist is missing you will just getMedia 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:
tokenizer.pyto media utils to process the label.