py3status
py3status copied to clipboard
formatter: add {:sanitize} to return song or song [feat]
DO NOT MERGE. An alternative to @dpeukert's https://github.com/ultrabug/py3status/pull/2234.
Pro:
- Works on all modules. Not restricted to music modules.
- Doesn't have to add anything to existing music modules.
- Remove couple of spotify configs.
Con:
- Non-config metadata patterns. I think users might not care. If they do, they can make PR that will help everybody.
- Abuse (?) Not what it was originally for. Got
:d
,:.2f
,:g
,:ceil
, and now:escape
and:sanitize
... Lol.
Instruction:
- To use this, just use
{title:sanitize}
,{album:sanitize}
in any modules (music or not). - You even can use
{title:escape,sanitize}
too. My testing is limited and short, but everything seems OK.
Default behavior:
- This can be set as default behavior for music modules by adding
class Meta
orself.py3.update_placeholder_formats
inpost_config_hook
... but if you add them on, there will no way for users to turn them off in theformat
config. This is same for other placeholders not related to this PR. Just a FYI.