Feature #3525
closed
It looks like another request to mangle the channel names to picon filenames. Doesn't ?
So actually "Channel icon name lower-case" should become a combobox with label 'channel name scheme' with two options 'lower-case names' and 'service name picons'.
Yes, something like that. It's more than just lower case, though, as there needs to be that standardised way to handle the special characters - so you mangle/slugify from "BBC Three HD with EXTRA &Bells+ on!!" to "bbcthreehdwithstarextrastarandbellsplus..." or however the translation in the sample code works.
If it's a recognised approach - and I don't know if this really is widely-adopted - then it at least gives a template way to handle it.
- Target version set to 4.2
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|afa1a3c417831970616421b02387bff917e0f6ef.
Added to v4.1-1422-gafa1a3c .
Thanks for this - it works well once you tweak a couple of options.
One question: the sample code seems to use a-z/0-9, translate &, + and *, and strip any other characters, if I understand it correctly:
name = re.sub('[^a-z0-9]', '', name.replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower())
... but I think your implementation just removes everything except a-z/0-9, does it not? I don't know which is the "correct" way vs just being a different approach. I suppose it depends on whether https://picons.xyz/ is definitive, as that's where the trail begins.
The svcnamepicons() does all string transitions:
1) lowercase
2) [a-z0-9] filter
3) replacing &, + and * with words
For example:
d[0] = 'a'; d[1] = 'n'; d[2] = 'd'; d += 3;
writes "and" to the destination string - see 'a' 'n' 'd' characters .....
Yup, that fixed it - it was obviously simply skipping over "+", which is the one I noticed as the most common of these characters. Working as intended, I think - thanks.
Also available in: Atom
PDF