Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include sd, fhd, and uhd in picon.py #3830

Closed
kiddac opened this issue Nov 11, 2023 · 16 comments
Closed

Include sd, fhd, and uhd in picon.py #3830

kiddac opened this issue Nov 11, 2023 · 16 comments

Comments

@kiddac
Copy link

kiddac commented Nov 11, 2023

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.

if not pngname:
    name = sanitizeFilename(ServiceReference(serviceRef).getServiceName())
    name = re.sub('[^a-z0-9]', '', name.replace('&', 'and').replace('+', 'plus').replace('*', 'star').lower())
    if len(name) > 0:
        pngname = findPicon(name)
        if not pngname and len(name) > 3 and (name.endswith("fhd") or names.endswith("uhd")) :
            pngname = findPicon(name[:-3])	
        if not pngname and len(name) > 2 and (name.endswith("hd") or names.endswith("sd") or names.endswith("4k") ):
            pngname = findPicon(name[:-2])`		
@kiddac
Copy link
Author

kiddac commented Nov 11, 2023

jbleyel on openatv has recommended a regex solution instead

if not pngname:
  name = sub("uhd$|fhd$|sd$|hd$|4k$", "", name)
  if name:
    pngname = findPicon(name)

@littlesat
Copy link
Member

I agree this is not Pli style. Please improve with 'sub'. Can be done in a kind of oneliner

@AbuBaniaz
Copy link
Contributor

The changes were added to the developer image. I have submitted a pull request to pick it into Release.
#3861

Issue can then be closed.

@WanWizard
Copy link
Member

WanWizard commented Dec 7, 2023

It might also be beneficial in that context to strip anything in square brackets from ths start.
And I have also seen "8K" (which if you're lucky is FHD), so this needs stripping too.

It would be better if IPTV tools would strip all this nonsense at the source though, instead of having to hack this into E2.

@AbuBaniaz
Copy link
Contributor

But if that was done, you would not know what the quality/resolution is supposed to be.

@AbuBaniaz
Copy link
Contributor

AbuBaniaz commented Dec 7, 2023

Please ignore. This is wrong.
On second thoughts and after comment by someone from another image, the wholesale trimming is not the best approach. The original suggestion where the trim is done if the full name is not found would have be better. That would have catered for channels where there are different logos for HD/SD channels.

@WanWizard
Copy link
Member

But if that was done, you would not know what the quality/resolution is supposed to be.

I don't understand that, it is fine to strip HD and 4K, but not 8K?

And I was referring to channel name prefixes, which are currently not stripped at all, like

[BE] [8K] Play Sports 4 HVEC

which needs two prefixes stripped, and a suffix which we currently don't strip.

@AbuBaniaz
Copy link
Contributor

AbuBaniaz commented Dec 7, 2023

My comment was in response to It would be better if IPTV tools would strip all this nonsense at the source though, instead of having to hack this into E2.. Not specific to 8k

My last comment is wrong, trims are done if the full name is not found

@AbuBaniaz
Copy link
Contributor

I have re-opened the pull request for 9.0 branch. I would be grateful if you can consider merging it.

@littlesat
Copy link
Member

As far I know this is included in a more smarter way.

@AbuBaniaz
Copy link
Contributor

It is only in Develop image.

@pr2git
Copy link
Contributor

pr2git commented Jun 22, 2024

Every IPTV providers has its own way to report there channels resolution (they are very creative on this), the implementation of the resolution strip was initially done for the satellite to have a fallback when there is no specific picon for hd (remember that at the very beginning of HD channels there was specific picon for those channels compared to SD one), so indeed the strip was done for the end of the string because it was there that it is placed on DVB transmission. And I agree that a regex would be better for perform this.

@WanWizard
Copy link
Member

As far I know this is included in a more smarter way.

Then why is this issue still open?

@AbuBaniaz
Copy link
Contributor

Because it is not in release image yet

@WanWizard
Copy link
Member

Leaving this open doesn't change that.

If it is in develop, the issue is dealt with, and available for the wider public in the net release.

@AbuBaniaz
Copy link
Contributor

I have created a pull request #4053
I hope you can merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants