Feature #3525

Implement Service Name Picons (vs Service Reference Picons)

Added by Prof Yaffle over 7 years ago. Updated over 7 years ago.

User Interface
Target version:
Start date:
Due date:
% Done:


Estimated time:


The current picon code uses service references - so frequency, orbital position, etc. - to identify which icon to use on which channel. However, I've found this to be patchy at best, requiring a lot of manual work afterwards to fill the gaps.

There also seems to be a way to use service names, so more like the current channel name approach - but with a standardised way to 'slugify' the channel names, and also to build the icons through the picon process.

More information here:

and sample code used to generate the names here:



Updated by Jaroslav Kysela over 7 years ago

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'.


Updated by Prof Yaffle over 7 years ago

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.


Updated by Jaroslav Kysela over 7 years ago

  • Target version set to 4.2

Updated by Jaroslav Kysela over 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|afa1a3c417831970616421b02387bff917e0f6ef.


Updated by Jaroslav Kysela over 7 years ago

Added to v4.1-1422-gafa1a3c .


Updated by Prof Yaffle over 7 years ago

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 is definitive, as that's where the trail begins.


Updated by Jaroslav Kysela over 7 years ago

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 .....


Updated by Prof Yaffle over 7 years ago

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