Open regorxxx opened 5 months ago
Certainly a useful tool for power users like yourself. If I understand correctly this would supersede the "Exclude text in brackets at the end of artist/album names" checkbox that we currently have.
We'd need to either continue supporting that option, or set a default if users have that option enabled (presumably involving $cut
and $strrchr
).
Without regexp is not trivial, but here it is:
-> My [hey] artist [ho] $puts(char,'[')$puts(tag,My '['hey']' artist '['ho']')$puts(spacer,$strrchr($get(tag),$get(char))) $ifequal($strrchr($get(tag),']'),$len($get(tag)),$trim($left($get(tag),$sub($get(spacer),1))),$get(tag)) -> My [hey] artist
-> My [hey] artist $puts(char,'[')$puts(tag,My '['hey']' artist)$puts(spacer,$strrchr($get(tag),$get(char))) $ifequal($strrchr($get(tag),']'),$len($get(tag)),$trim($left($get(tag),$sub($get(spacer),1))),$get(tag)) -> My [hey] artist
It only removes the brackets if the last char is ']':
$puts(char,'[')$puts(tag,%ARTIST%)$puts(spacer,$strrchr($get(tag),$get(char)))
$ifequal($strrchr($get(tag),']'),$len($get(tag)),$trim($left($get(tag),$sub($get(spacer),1))),$get(tag))
Minified:
$ifequal($strrchr(%ARTIST%,']'),$len(%ARTIST%),$trim($left(%ARTIST%,$sub($strrchr(%ARTIST%,'['),1))),%ARTIST%)
Personally I would leave the option as is, since it's already coded, on top of the TF.
Allow to configure the artist and title web lookup, so things like multiple artist, exotic chars or personalized tags can be handled via TF:
For ex. [$stripprefix($meta(artist,0))] or [$replace(%title%,$char(40),,$char(41),)]...
Example from Lyrics Show 3:![image](https://github.com/jacquesh/foo_openlyrics/assets/83307074/ce031efd-4320-41f8-a4e2-cc1001e00125)
Note this allows an infinite amount of possibilities to fix common problems looking for things.