Closed kiddac closed 10 months ago
Have you tested this?
Nope. But I can do for you.
Nope. But I can do for you.
I'm thinking about to use regex instead. Because it's probably faster.
`
name = sub("[^a-z0-9]", "", name.replace("&", "and").replace("+", "plus").replace("*", "star").lower())
if name:
pngname = findPicon(name)
if not pngname:
name = sub("uhd$|fhd$|sd$|hd$|4k$", "", name)
if name:
pngname = findPicon(name)
`
Either way it would be an improvement.
using simple additions to existing code. I editted my code above as the the 3 chars had to come before the 2 chars.
before
after
I will try a regex solution now. We possibly could get away with not being the end of line too. "SD" being the only one that could potentially exist in the middle of a channel name.
That way if a name for example is [SD] BBC ONE. It would fix that one too.
your regex sub works as expected too.
@kiddac , @jbleyel would it be possible to add these IPTV picons in subfolders? Like IPTVProvider1, IPTVProvider2, and so on?
With PlutoTV, BMX, SamsungTV and all this plugins that creates Picons an Bouquets the Picon directory gets so big and not easy to manage without folders in it
And to clarify what @Masta2002 is getting at. My new plugin bouquetmakerxtream for example now has a picon downloader included
The user selects the picon location.
i.e media/hdd/picon/
All picons get downloaded into that folder.
Picon.py is currently coded to only look for PNGs in /picon/ folder of that mount and not also subfolders of that /picon/ folder. Which not only would be good for iptv picons, but also allow the organisation of other downloaded picon sets
Hello @Masta2002 , subfolders for picons will be very complex and complicated. So I'm not intended to implement this now.
How ever this discussion will end, i suggest to only use one single path for ALL picons in the system. Every other attempt will lead to massive confusions, need much effort to implement, and also support will be not longer possible.
In a world of iptv would it be possible to amend the picon.py to include iptv references like sd, fhd, uhd, 4k
Currently SNP picons look for name and if ends with HD strips the HD
It would now be better if this code also incorporates other IPTV values like SD,4K, FHD, UHD to pick up more IPTV channels
Example new code.