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 #141 doglover

  • Rytec EPG Team
  • 17,387 posts

+658
Excellent

Posted 24 June 2019 - 16:04

Nice.

 

I only hope that users, do not have such a long customs.channel.xml file as I have.

Before we started on testing this, I was trying something out with this file.  And this file is still there and I get a very long list of skipped service refs.

But this is of course, just my set-up here.

 

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 #142 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 24 June 2019 - 16:32

Mmmm it wasn’t there?!

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 #143 Huevos

  • PLi® Contributor
  • 4,661 posts

+163
Excellent

Posted 24 June 2019 - 16:38

Give me a few minutes because I've noticed other bugs too.



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

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 24 June 2019 - 17:00

Thanks I cannot make changes anymore today.

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 #145 Huevos

  • PLi® Contributor
  • 4,661 posts

+163
Excellent

Posted 24 June 2019 - 19:59

Willy please test this version.

 

Attached Files



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

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 24 June 2019 - 20:02

Can you also post a diff as that helps to discuss 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 #147 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 24 June 2019 - 20:06

And when I see the sanity checks it looks like you try some ‘crapy’ settings?....
And please put break on a second line after the not valid check.

Edited by littlesat, 24 June 2019 - 20:07.

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 #148 Huevos

  • PLi® Contributor
  • 4,661 posts

+163
Excellent

Posted 24 June 2019 - 22:54

And when I see the sanity checks it looks like you try some ‘crapy’ settings?....
And please put break on a second line after the not valid check.

In your patch you put a try/except that will return "None" on failure. I just want to avoid that "None" value from being appended to the list we are creating.

 

One other small change is change variable name from "refstr" to "refnum"

--- plugin-old.py	Mon Jun 24 23:30:40 2019
+++ plugin.py	Mon Jun 24 23:29:56 2019
@@ -110,6 +110,13 @@
 	alternativeServices = enigma.eServiceCenter.getInstance().list(service)
 	return alternativeServices and alternativeServices.getContent("S", True)
 
+def getRefNum(ref):
+    ref = ref.split(':')[3:7]
+    try:
+        return int(ref[0], 16) << 48 | int(ref[1], 16) << 32 | int(ref[2], 16) << 16 | int(ref[3], 16) >> 16
+    except:
+        return
+
 def getBouquetChannelList():
 	channels = [ ]
 	global isFilterRunning, filterCounter
@@ -140,13 +147,13 @@
 										altrernative_list = getAlternatives(service)
 										if altrernative_list:
 											for channel in altrernative_list:
-												refstr = ':'.join(channel.split(':')[:11])
-												if refstr not in channels:
-													channels.append(refstr)
+												refnum = getRefNum(channel)
+												if refnum and refnum not in channels:
+													channels.append(refnum)
 									else:
-										refstr = ':'.join(service.toString().split(':')[:11])
-										if refstr not in channels:
-											channels.append(refstr)
+										refnum = getRefNum(service.toString())
+										if refnum and refnum not in channels:
+											channels.append(refnum)
 	else:
 		bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'
 		bouquet_root = enigma.eServiceReference(bouquet_rootstr)
@@ -161,13 +168,13 @@
 						altrernative_list = getAlternatives(service)
 						if altrernative_list:
 							for channel in altrernative_list:
-								refstr = ':'.join(channel.split(':')[:11])
-								if refstr not in channels:
-									channels.append(refstr)
+								refnum = getRefNum(channel)
+								if refnum and refnum not in channels:
+									channels.append(refnum)
 					else:
-						refstr = ':'.join(service.toString().split(':')[:11])
-						if refstr not in channels:
-							channels.append(refstr)
+						refnum = getRefNum(service.toString())
+						if refnum and refnum not in channels:
+							channels.append(refnum)
 	isFilterRunning = 0
 	return channels
 
@@ -176,19 +183,19 @@
 	if not ref:
 		return False
 	sref = enigma.eServiceReference(ref)
-	refstr = ':'.join(sref.toString().split(':')[:11])
+	refnum = getRefNum(sref.toString())
 	if config.plugins.epgimport.import_onlybouquet.value:
 		global BouquetChannelListList
 		if BouquetChannelListList is None:
 			BouquetChannelListList = getBouquetChannelList()
-		if refstr not in BouquetChannelListList:
-			print>>log, "Serviceref not in bouquets:", refstr
+		if refnum not in BouquetChannelListList:
+			print>>log, "Serviceref not in bouquets:", sref.toString()
 			return False
 	global serviceIgnoreList
 	if serviceIgnoreList is None:
-		serviceIgnoreList = filtersServices.filtersServicesList.servicesList()
-	if refstr in serviceIgnoreList:
-		print>>log, "Serviceref is in ignore list:", refstr
+		serviceIgnoreList =  [getRefNum(x) for x in filtersServices.filtersServicesList.servicesList()]
+	if refnum in serviceIgnoreList:
+		print>>log, "Serviceref is in ignore list:", sref.toString()
 		return False
 	if "%3a//" in ref.lower():
 		# print>>log, "URL detected in serviceref, not checking fake recording on serviceref:", ref



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

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 25 June 2019 - 06:33

Indeed the None should not be added :)

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 #150 doglover

  • Rytec EPG Team
  • 17,387 posts

+658
Excellent

Posted 25 June 2019 - 06:55

#146 seems to work.

 

The log lists also now:

Serviceref not in bouquets: 1:0:1:1C0E:1C:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:1:83F:19:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:16:1BAD:19:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:16:132B:48:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:16:45F3:48:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:16:132A:48:46:E080000:0:0:0:
Serviceref not in bouquets: 1:0:16:132A:48:46:E080000:0:0:0:

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 #151 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 25 June 2019 - 07:04

The last one from Huevos is good... might only need some finetuning (and considering to move refnum en get all bouquet services to a tool or so, other plug-ins might use it aswell)

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 #152 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 25 June 2019 - 08:41

I just forwarded to WanWizard that he can merge #146's plugin.py... I do not want to add some finetuning :)...(see it as big compliment).

And also thanks for Doglover for testing


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 #153 littlesat

  • PLi® Core member
  • 57,166 posts

+698
Excellent

Posted 25 June 2019 - 08:43

P.S.

1. Do we also agree with this statement...'I also thing a selection by userbouquet is not really required as you can also already select the xml which you like...'?

2. And another question is the ignore list mandatory or can we also consider to remove it? or do we just leave it as it does not harm (it still can solve when you only want to see EIT for a special service).


Edited by littlesat, 25 June 2019 - 08:44.

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 #154 doglover

  • Rytec EPG Team
  • 17,387 posts

+658
Excellent

Posted 25 June 2019 - 09:14

I did not know before of the existence of the ignore list.

But I can see it can have its use. So leave it as is.

 

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 #155 ColinB

  • Senior Member
  • 743 posts

+28
Good

Posted 25 June 2019 - 09:18

Thanks Littlesat. "Muda" is now my word of the day

 

https://en.wikipedia...(Japanese_term)

 

No offense ment. Just cool.


Xtrend et8000 7.1-Release

2 x 8/1 DiSEqC  30w 13e 19e 23e 28e   

Astrometa USB Tuner Working DVB-T2 now on Kernel 4.10+  ;)

WD10EARX 1TB

Sandisk 32GB USB for AFB, EPG, Picons & Timeshift

 

ZGemma Star S 7.0-Release

4/1 DiSEqC  30w 13e 19e 28e

Sandisk 8GB USB for AFB, EPG, Picons & Timeshift

 

LG 49UH610V UHD-HDR

UHF/Cable/Sat

 

E-Channelizer

 

 

 


Re: Only import EPG for channels in Bouquets - change requested #156 Pr2

  • PLi® Contributor
  • 6,181 posts

+261
Excellent

Posted 25 June 2019 - 12:42

P.S.
1. Do we also agree with this statement...'I also thing a selection by userbouquet is not really required as you can also already select the xml which you like...'?

 
I agree.
 

And another question is the ignore list mandatory or can we also consider to remove it? or do we just leave it as it does not harm (it still can solve when you only want to see EIT for a special service).


Leave it, if I remember well this was introduced by another plugin that allows to load EPG only for channels were people really wants EPG.

This was done for low-end STB with really poor memory.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


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

  • PLi® Core member
  • 70,523 posts

+1,810
Excellent

Posted 25 June 2019 - 12:52

I just forwarded to WanWizard that he can merge #146's plugin.py... I do not want to add some finetuning :)...(see it as big compliment).

And also thanks for Doglover for testing

 

There is no attachment in #146.

 

Do you mean the attachment in #145, or the diff in #148, or perhaps both?


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 #158 Huevos

  • PLi® Contributor
  • 4,661 posts

+163
Excellent

Posted 25 June 2019 - 13:09

1) It is required. The XML may contain 100 channels and only 5 of them are in your userbouquets. For example I have TF1 and France 2-5 in my bouquets. No other French channels. The XML for basic French channels contains a lot more channels. If that option were removed I would have hundreds of channels loaded in my epg-cache that I never watch.



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

  • PLi® Contributor
  • 4,661 posts

+163
Excellent

Posted 25 June 2019 - 13:18

@WanWizard, I've created a PR.

 

https://github.com/O...gimport/pull/27



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

  • PLi® Core member
  • 70,523 posts

+1,810
Excellent

Posted 25 June 2019 - 13:23

Thanks, merged.


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.



16 user(s) are reading this topic

0 members, 16 guests, 0 anonymous users