Jump to content


Photo

Only import EPG for channels in Bouquets - change requested


  • Please log in to reply
164 replies to this topic

Re: Only import EPG for channels in Bouquets - change requested #21 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 14:40

It looks complicated... but something like this... (untested trimmer)...

 

if ":".join(refstr.strip(":")[:2] + refstr.strip(":")[3:]) not in [":".join(x[:2] + x[3:]) for x in [x.split() for x in BouquetChannelListList]]:

 

And it also has a another bug as the ref in BouquetChannelList could have more content..

 

Means this might be even better (please check if 11 here does not need to be changed to 10)....

 

if ":".join(refstr.strip(":")[:2] + refstr.strip(":")[3:]) not in [":".join(x[:2] + x[3:11]) for x in [x.split() for x in BouquetChannelListList]]:


Edited by littlesat, 19 June 2019 - 14:42.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #22 doglover

  • Rytec EPG Team
  • 17,394 posts

+658
Excellent

Posted 19 June 2019 - 14:56

OK. 

 

The comparison has to be case independent.

Skip the first and third parameter.  The second is always zero, so you can skip that one too.  That is why it said skip the first 3 parameters.

For EPG the first parameter is of no importance.

 

And then I just said there could be something behind the service ref (an URL) in both the channel file and the bouquet file.  Do not compare these.  Be aware of this.

It was just a remark that there could be some info.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Only import EPG for channels in Bouquets - change requested #23 WanWizard

  • PLi® Core member
  • 70,544 posts

+1,813
Excellent

Posted 19 June 2019 - 15:28

if ":".join(refstr.strip(":")[:2] + refstr.strip(":")[3:]) not in [":".join(x[:2] + x[3:]) for x in [x.split() for x in BouquetChannelListList]]:

 

Why would you do a split for every entry in BouquetChannelListList? This is exactly what not to do, see my comments above.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Only import EPG for channels in Bouquets - change requested #24 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 16:23

The is indeed a faster way by trying on 1, 16, 19 by just replacing the 3rd value from the refstr...

Edited by littlesat, 19 June 2019 - 16:25.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #25 Abu Baniaz

  • PLi® Contributor
  • 2,500 posts

+64
Good

Posted 19 June 2019 - 16:37

Willy is asking we ignore the first three parts of service reference. Not that we try different values in those positions.



Re: Only import EPG for channels in Bouquets - change requested #26 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 16:43

When you ignore more etc... then it might be better to ‘recompile’ the service list as I described.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #27 doglover

  • Rytec EPG Team
  • 17,394 posts

+658
Excellent

Posted 19 June 2019 - 16:56

In addition of 1, 16 and 19 there is also 1F for UHD channels.

Of course they are scarse at the moment.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*


Re: Only import EPG for channels in Bouquets - change requested #28 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 19 June 2019 - 17:03

Well in my Plugin There is a miniref Methode doing this Job, feel free to borrow...

Re: Only import EPG for channels in Bouquets - change requested #29 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 18:12

Yes you’re the upper best gutemine... as you can see here we’re discussing a kind of miniref... you always invent thinks first! Maybe we come with something smarter... just hold on... split the reference and only compare the stuff that is really needed does the job... eg ref.split(‘:’)[3:7] or so.... and then compare these lists instead of combine them. (The 7 might be finetuned)

Edited by littlesat, 19 June 2019 - 18:17.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #30 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 19 June 2019 - 19:19

I'm Not smarter, I simply decided when I started to Produce my own Plugin from Scratch Not to repeat too many of the Problems that EPGImport still has after so many years of development. Now I have my own Code where I can add all the functionality I Always wanted to have ... and Off course also do my own dumb mistakes or Design Errors, or ....

And regarding your other comment, I only ship uncompiled Python in all my Plugins since 15 years.

Edited by gutemine, 19 June 2019 - 19:23.


Re: Only import EPG for channels in Bouquets - change requested #31 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 19 June 2019 - 21:53

mini sref method:

def miniServiceReference(sref):                                                 
        if sref is None:                                                        
                return sref                                                     
        sp=[]                                                                   
        sp=sref.split(":")                                                      
        if len(sp) > 9:                                                         
                sref=":%s:%s:%s:%s:" % (sp[3].upper(),sp[4].upper(),sp[5].upper(),sp[6].upper())
#       cprint("[EPGLOAD] MINI service reference %s" % sref)                    
        return sref                         

And yes, EPGLoad applies this method also when creating the channel list (Either All services or the selected bouquets for loading), all Services for inspiration:

def getAllServices():                                                           
        allservices = []                                                        
        s_type = service_types_tv                                               
        idbouquet = '%s ORDER BY name' % (s_type)                               
        epgcache = eEPGCache.getInstance()                                      
        serviceHandler = eServiceCenter.getInstance()                           
        services = serviceHandler.list(eServiceReference(idbouquet))            
        channels = services and services.getContent("SN", True)                 
        for channel in channels:                                                
                mref=miniServiceReference(channel[0])                           
                allservices.append(mref)                                        
#       cprint("[EPGLOAD] TOTAL TV SERVICES %d" % len(allservices))             
        return allservices                                                      

Edited by gutemine, 19 June 2019 - 21:55.


Re: Only import EPG for channels in Bouquets - change requested #32 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 22:19

That miniref can be done much easier and readable.., you only take value 3,4,5,6 and ensure the hexvalies are uppercase.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #33 Lost in Space

  • Senior Member
  • 876 posts

+69
Good

Posted 19 June 2019 - 22:22

You are repeating yourself ;-)

Re: Only import EPG for channels in Bouquets - change requested #34 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 19 June 2019 - 22:27

No.. I’m not repeating at all...

‘:’.join(sref.upper().split(‘:’)[3:7])

Sounds we are trying to do exactly the same..

Edited by littlesat, 19 June 2019 - 23:13.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #35 Abu Baniaz

  • PLi® Contributor
  • 2,500 posts

+64
Good

Posted 20 June 2019 - 01:08

May I interject and add that the namespace subnet feature has not been catered for. Can this be looked at please? This is very useful for people who can receive from two terrestrial masts.



Re: Only import EPG for channels in Bouquets - change requested #36 Huevos

  • PLi® Contributor
  • 4,663 posts

+163
Excellent

Posted 20 June 2019 - 01:49

I think it was better to simply always make the service reference 1 for video and 2 for radio (audio only). It totally does not help E2 to put here more details. To check if a channel is SD or HD etc... is also detected 'afterwards'.... so for me in E2 each 19 can be replaced by 1 etc...

Those numbers should not be changed. They are there for a reason. For example 22 means it is an SD service carried on a DVB-S2 transport stream. Therefore we cannot select a DVB-S tuner, it must be a DVB-S2 tuner. That is just one example.



Re: Only import EPG for channels in Bouquets - change requested #37 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 20 June 2019 - 06:56

Indeed here it is used... for the ui it is not used at all for the indication of codec etc... for the epg import the mini or ‘stripped’ service reference equation should solve it.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #38 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 20 June 2019 - 08:10

When someone can test this... (untested - created by heart). This is only doing it for bouquets... not (yet) for ignore list.

diff --git a/src/EPGImport/plugin.py b/src/EPGImport/plugin.py
index ef3cd15..c0a8866 100644
--- a/src/EPGImport/plugin.py
+++ b/src/EPGImport/plugin.py
@@ -173,6 +173,11 @@ def getBouquetChannelList():
 
 # Filter servicerefs that this box can display by starting a fake recording.
 def channelFilter(ref):
+       def stripReference(ref):
+               try:
+                       return ':'.join(ref.upper().split(':')[3:7])
+               except:
+                       return ref
        if not ref:
                return False
        sref = enigma.eServiceReference(ref)
@@ -181,7 +186,7 @@ def channelFilter(ref):
                global BouquetChannelListList
                if BouquetChannelListList is None:
                        BouquetChannelListList = getBouquetChannelList()
-               if refstr not in BouquetChannelListList:
+               if stripReference(refstr) not in [stripReference(x) for x in BouquetChannelListList]:
                        print>>log, "Serviceref not in bouquets:", refstr
                        return False
        global serviceIgnoreList

Attached Files


Edited by littlesat, 20 June 2019 - 08:14.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #39 littlesat

  • PLi® Core member
  • 57,182 posts

+699
Excellent

Posted 20 June 2019 - 08:18

This should also do this for the ignore list...

diff --git a/src/EPGImport/plugin.py b/src/EPGImport/plugin.py
index ef3cd15..db3069b 100644
--- a/src/EPGImport/plugin.py
+++ b/src/EPGImport/plugin.py
@@ -173,20 +173,27 @@ def getBouquetChannelList():
 
 # Filter servicerefs that this box can display by starting a fake recording.
 def channelFilter(ref):
+
+       def stripReference(ref):
+               try:
+                       return ':'.join(ref.upper().split(':')[3:7])
+               except:
+                       return ref
+
        if not ref:
                return False
        sref = enigma.eServiceReference(ref)
-       refstr = ':'.join(sref.toString().split(':')[:11])
+       refstr = stripReference(':'.join(sref.toString().split(':')[:11]))
        if config.plugins.epgimport.import_onlybouquet.value:
                global BouquetChannelListList
                if BouquetChannelListList is None:
-                       BouquetChannelListList = getBouquetChannelList()
+                       BouquetChannelListList = [stripReference(x) for x in getBouquetChannelList()]
                if refstr not in BouquetChannelListList:
                        print>>log, "Serviceref not in bouquets:", refstr
                        return False
        global serviceIgnoreList
        if serviceIgnoreList is None:
-               serviceIgnoreList = filtersServices.filtersServicesList.servicesList()
+               serviceIgnoreList = [stripReference(x) for x in filtersServices.filtersServicesList.servicesList()]
        if refstr in serviceIgnoreList:
                print>>log, "Serviceref is in ignore list:", refstr
                return False

Attached Files


Edited by littlesat, 20 June 2019 - 08:19.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Only import EPG for channels in Bouquets - change requested #40 doglover

  • Rytec EPG Team
  • 17,394 posts

+658
Excellent

Posted 20 June 2019 - 10:31

Will test it.

But do not expect results within 5 minutes.

 

Willy


~~Rytec Team~~
Maxytec Multibox SE OpenPli (used as mediaplayer)
Mutant HD2400 OpenPli
Vu+ Duo OpenPli (backup)

Synology NAS

Sat: 13E, 19.2E, 23.5E and 28.2E
*Pli/Rytec EPG POWERED*



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users