Help with program guide python code
#1
Hopefully Lunatixz will see this.  This is probably more of a python question than a PseudoTV question.  FYI, I have 30+ years of software development experience so don't be afraid to confuse me.  I began modifying my copy of PseudoTV to make it more to my liking.  It is part of a "retro" setup on an old school television that creates the old school cable experience.  As part of this I created a "program guide channel", a scrolling channel that scrolls what is currently playing.  Basically when a user turns to channel 2 my code kicks in and shows an overlay above the playing video that scrolls the listings.

To do this I borrowed some code from EPGWindow.py since I assumed this was the best part to grab code that would give me a list of channels as well as what is currently playing on them.  I took this code and wrote it up and modified it to do just that.  For the most part the code works flawlessly and provides me with a list of the current channels, their names, as well as what is currently playing.  However at random there are channels that are 100% wrong.  I don't just mean they are off by a show or two, they are way wrong.  I started putting in code that would tell me what is going on in the background and I have found that the channels that are incorrect are the ones that produce a playlistpos of 0 (the beginning of the playlist for that channel).   As the code stands right now I have it outputting the section of code where the calculations come from, as well as the current epochBeginDate.  This data is appended to the channel listings on my guide screen, just for me to reference and find out what is going on.

By analyzing the code it seems that Lunatixz was attempting to iterate through channels, use the current system time by comparing it to the "time" in the channel playlist.  In which a loop is created to loop through each video, compound the total time, and exit the loop when the total time reflects the currently playing program.  

I cannot figure out why certain channels are not pulling the info properly.  Also if a channel does not pull correct info and I turn to that channel and then turn back, the information is corrected.  So it seems that there is some data updating that is not taking place 100% of the time in regards to channel times.  Actually, I always remember PseudoTV being notorious for losing your place on channels, especially after you exit and come back in.  I would switch to a channel and it would be miles behind where you would basically experience a repeat.  I ended up fixing that particular issue so now the channels are 100% every time.  But I still cannot get this guide channel data to populate properly.

As it stands right now, the epochBeginDate as well as the playlist position is appended to each line of the guide data.  All listings show an epochBeginDate, which is usually a very long number, the incorrect channels show a playlistpos of 0.

Here is the code that populates the guide data, which is very similar to that from the program guide code.  I tried to comment as heavily as I could.

https://paste.kodi.tv/genaficolu

Any suggestions would be appreciated
Reply


Messages In This Thread
Help with program guide python code - by soundman1611 - 2019-08-28, 18:55
Logout Mark Read Team Forum Stats Members Help
Help with program guide python code1