Jump to content


Photo

EPGnow - Ability to set value.

EPGnow EPG

  • Please log in to reply
26 replies to this topic

#1 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 17 March 2023 - 23:57

It seems like EPGnow and EPGnext are variables different from the main EPG.  Is there a way through python scripts or http call or telnet, to be able to SET the EPGnow value for the current service your tuned too.

 

I am working on a method to view the current song playing on a radio service.  I can get the information by decoding XML data from a website.  There is no timing information on the website.  It only contains the current song playing and the last 10 songs.  Currently, for testing purposes, i am detecting the service, and decoding the XML data, and then displaying it via a Enigma2 Message Box.

 

I've done exhaustive google searches, and there doesn't seem to be any information on how to SET the values, only to retrieve the values.

 

Any help or direction pointing to further clues would be appreciated.

 

Thank you.


Edited by LoveMyDish, 18 March 2023 - 00:00.


Re: EPGnow - Ability to set value. #2 scriptmelvin †

  • PLi® Contributor
  • 720 posts

+46
Good

Posted 18 March 2023 - 01:13

Is the radio service a shoutcast/icecast stream (with song info embedded in the audio stream)? Then you can install the OpenPLi develop image, there it already works.

 

See also this post.


Sorry to inform you this member, my brother, passed away.

Re: EPGnow - Ability to set value. #3 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 18 March 2023 - 13:44

Ill take a look, but this is not a stream, it is a satellite signal.  Maybe there will be something i can use from it... Thank you.



Re: EPGnow - Ability to set value. #4 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 18 March 2023 - 14:39

Is the radio service a shoutcast/icecast stream (with song info embedded in the audio stream)? Then you can install the OpenPLi develop image, there it already works.

 

See also this post.

Actually, this did point me in the right direction with the EventInfo.py file in the /usr/lib/enigma2/python/Components/Sources 

 

I successfully added a Class and put my own custom EventNow and EventNext!!!  Perfect.. Now, ill have to play with this to get it incorporated and utilize the way i need to...

 

Thank you scriptmelvin


Edited by LoveMyDish, 18 March 2023 - 14:39.


Re: EPGnow - Ability to set value. #5 scriptmelvin †

  • PLi® Contributor
  • 720 posts

+46
Good

Posted 18 March 2023 - 17:43

Thanks for the feedback. Please let us know when (and how) you got it working :)


Sorry to inform you this member, my brother, passed away.

Re: EPGnow - Ability to set value. #6 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 18 March 2023 - 19:06

I successfully was able to Set the EPGnow and EPGnext variables... So, that is a step forward....  But......i ran into a snag.  It appears the EventInfo.py is only called when you change to a new service.  I need to trigger an update to the EPGnow and EPGnext when i initiate the infobar...  So, im back to the grind working on that step...

 

Any thoughts...



Re: EPGnow - Ability to set value. #7 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 18 March 2023 - 20:58

Hi,
Currently the epg is update on channel info changed event that is triggered after you switch to a channel. The problem is that for iptv service for example that can delay several second. For that cases indeed the infobar should update itself immediately on show. That means source eventinfo and current service to be possible to be triggered on infobar show.

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #8 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 19 March 2023 - 13:56

Hi,
Currently the epg is update on channel info changed event that is triggered after you switch to a channel. The problem is that for iptv service for example that can delay several second. For that cases indeed the infobar should update itself immediately on show. That means source eventinfo and current service to be possible to be triggered on infobar show.

I agree, and thats the same thing i ran into.  Do you have any thoughts on which python files would be best to hook this in?



Re: EPGnow - Ability to set value. #9 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 19 March 2023 - 14:35

Well you May look here
https://github.com/O...oBarGenerics.py
and
https://github.com/O...ssionGlobals.py

You have to make source in sessionglobal to refresh on infobar show.
For infobar show look in infobargenerics

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #10 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 19 March 2023 - 17:14

Well you May look here
https://github.com/O...oBarGenerics.py
and
https://github.com/O...ssionGlobals.py

You have to make source in sessionglobal to refresh on infobar show.
For infobar show look in infobargenerics

Too funny, yea, i had already tracked back to the sessionglobals.py before reading this. in SessionGlobals.py I found the following :

        self["Event_Now"] = EventInfo(session.nav, EventInfo.NOW)
        self["Event_Next"] = EventInfo(session.nav, EventInfo.NEXT)

I utilized grep to see that is the ONLY place the self["Event_Now"] is utilized / set.

 

I had already deciphered, and modified the scripts within the EventInfo call to be able to modify the Epg information.  But, like i mentioned before, i am attempting to invoke a manual update of those two variables.  Event_Now and Event_Next

 

As a test, and i thought it would be neat if i could invoke an update of those two variables through the webAPI.

 

I attempted to utilize the same code above in an api call to get the following error : Object does not support item assignment error

I then attempted the following : (comment # was what i had before that yielded the Assignment Error)

I then attempted to use the setattr and that ran without error, but did NOT update the EPG info.  So, i don't believe the setattr is yielding the results i need.

            ei = EventInfo(self.session.nav, EventInfo.NOW)
            setattr(self,"Event_Now",ei)
            #self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW)

I have been a programmer for 30+ years, however, I am not Python savy, so, that makes it more difficult for me.    Any thoughts on how i would go about being able to set the self["Event_Now"] outside of the sessionglobals.py

 

I was hoping to be able to update just those two variables, without having to re-invoke the whole sessionglobals as to not run processes that were not necessary.  But, i will in the meantime see if i can at least get an entire sessions globals update.


Thanks by the way... :)


Edited by LoveMyDish, 19 March 2023 - 17:18.


Re: EPGnow - Ability to set value. #11 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 19 March 2023 - 17:35

You try to update them wrong. Look inside it sets current service variable. You have to preset that to the service that you are zapping to. Or update event object. I did that already on my side because of iptv service with imported epg. I will search for example and post it later.

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #12 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 19 March 2023 - 17:36

P.S. I am also not a python guy but use it a lot lately.

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #13 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 19 March 2023 - 17:48

You try to update them wrong. Look inside it sets current service variable. You have to preset that to the service that you are zapping to. Or update event object. I did that already on my side because of iptv service with imported epg. I will search for example and post it later.

Maybe i am not understanding correctly, but i want it to utilize the current service (currently tuned too) So, isn't that what i want??  I don't want it to be what i am zapping to in the future, but what service i am currently at...



Re: EPGnow - Ability to set value. #14 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 19 March 2023 - 18:10

And thank you, and example would be nice..



Re: EPGnow - Ability to set value. #15 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 19 March 2023 - 19:02

If i understood correct you switch the channel and expect epg info to update immediately. Right? Switching a channel dont immediately raise event info update event. You want to move the update to be raise immediately on infobar show. Isnt it that what you want?

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #16 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 19 March 2023 - 19:11

In addition if you want to update the current epg info from internet... There are 2 ways in my opinion.
1. To set the data to the epg cache. That will make things to works like it is. You only have to get the service epg data from internet and write it in epg cache.
2. Make your own source like epgnow source and make it pollable so to get information on specific interval.

Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #17 LoveMyDish

  • Senior Member
  • 27 posts

0
Neutral

Posted 19 March 2023 - 23:35

If i understood correct you switch the channel and expect epg info to update immediately. Right? Switching a channel dont immediately raise event info update event. You want to move the update to be raise immediately on infobar show. Isnt it that what you want?

Yes, you are correct that i would want it to update the EPGcache, or the EPGnow/EPGnext event when you pull up the infobar for the current channel you are on.  I already fetch and decode the song information from the web, I just need a means to update it to show on the infobar  EPG now and Next event....



Re: EPGnow - Ability to set value. #18 el bandido

  • Senior Member
  • 364 posts

+13
Neutral

Posted 20 March 2023 - 03:41

Have you looked at the InfoBar.py and InfoBarGenerics.py in /usr/lib/enigma2/python/Screens?  You might consider building your own image which would give more freedom in modifying files. Just depends on what you want to do.



Re: EPGnow - Ability to set value. #19 DimitarCC

  • PLi® Contributor
  • 1,333 posts

+46
Good

Posted 21 March 2023 - 08:06

I did it in this way:

 

in EventInfo.py add new function

def updateSource(self, ref):
	if not ref:
		self.service = None
		self.changed((self.CHANGED_CLEAR,))
		return
	self.service = ref
	sself. Changed(self.CHANGED_ALL,))

That in my case replace the service that info is gotten from.

 

And just call that on the place you want like that:

self.session.screen["Event_Now"].updateSource(dest_ref)
self.session.screen["Event_Next"].updateSource(dest_ref)

Ofcource in my case i update the service. But you can update the event returned values if you like. here:

def getEvent(self):
		service = self.navcore.getCurrentService() if not self.service else self.service
		info = service and service.info()
		ret = info and info.getEvent(self.now_or_next)
		if info:
			if not ret or ret.getEventName() == "":
				refstr = info.getInfoString(iServiceInformation.sServiceref)
				ret = self.epgQuery(eServiceReference(refstr), -1, self.now_or_next and 1 or 0)
				if not ret and refstr.split(':')[0] in ['4097', '5001', '5002', '5003']: # No EPG Try to get Meta
					ev = pServiceEvent(info, self.now_or_next, service)
					if ev.getEventName:
						return ev
		return ret

You have to play with it however.

 

Also if you like to write in epg cache then you can look at EPGImport plugin.


Vu+DUO4KSE, DM920UHD, Vu+Uno4KSE, SF8008Mini, Vu+Solo2, Dreambox DM500HD, Triax 78 (7E,9E,13E,19.2E,23.5E) & Triax 78 (39E)


Re: EPGnow - Ability to set value. #20 Pr2

  • PLi® Contributor
  • 6,074 posts

+257
Excellent

Posted 21 March 2023 - 15:49

I will probably say something stupid but there is an option in the GUI settings to pop-up the infobar on program change based on the EPG information.

Isn't it what you are looking for?


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
 



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users