kodi-pvr / pvr.hdhomerun

Kodi's HDHomeRun client addon
GNU General Public License v2.0
20 stars 24 forks source link

pvr.hdhomerun updates #93

Closed djp952 closed 4 years ago

djp952 commented 4 years ago

This PR attempts to update pvr.hdhomerun to resolve a minor concern noted during local testing:

PVR API 6.2.0 changed how Original Air Date is to be reported. The HDHomeRun backend provides this value as a UTC Unix epoch "date". Using localtime() will adjust this date left if the user's system is West of Greenwich, England. The proposed change indicates that the supplied epoch is GMT, which should correct it for all users.

phunkyfish commented 4 years ago

Curious, have you experienced the race conditions? I believe (and stand to be corrected) that only one EPG update should be possible at a time. It should be similar for calls for channels and groups.

I remember a couple of years ago there was a race condition around EPG data in kodi PVR. It affected pvr.vuplus at the time. Although I think that may have been fixed since then.

djp952 commented 4 years ago

Yes, it tends to happen if you navigate into the TV area of the UI while the PVR Manager is starting up. I think you need to have some "Recent Channels" populated, so the UI will try to load the current EPG data to show you what's on that channel now, but I didn't think the capture the exact call stacks. Let me get you more detailed info on the sequence of events tonight before making any decisions here. The proposed change is a little heavy-handed anyway, copying all the strings into a list is wasteful, but I wanted to keep the proposal simple to review.

I also want to apologize for not noticing the localtime vs. gmtime thing when I tried this last week. I should have caught that.

phunkyfish commented 4 years ago

That would be great. Cause I wonder if this is something that should be fixed in core instead if it’s a problem.

Don’t worry about local time. I don’t think anyone noticed it. And as it’s day specific only probably not too big an issue 😉

djp952 commented 4 years ago

sigh. Of course I can't duplicate it now. Debug builds, artificially slowing things down, etc. Would you be OK with a much more trivial update just to switch to gmtime() and update libhdhomerun? I think the last time I saw this was before ksooo's EPG updates so maybe the deadlock is indeed a non-issue now.

Someday I hope to actually contribute something truly meaningful to this addon.

phunkyfish commented 4 years ago

Of course the smaller PR is welcome 😉

On the locking issue pvr.vuplus and pvr.vbox both have some crazy workarounds from before the recent changes. I really should remove them but I always worry I’ll have to put them back cause of an edge case. Race conditions are always tricky!

phunkyfish commented 4 years ago

If there are some things you would like to implement or you just need some ideas let me know 😉

djp952 commented 4 years ago

locking changes removed. If I can get them to happen again I'll capture the call stacks and report back to ya :) There is something I would LOVE to see get into Kodi but it got nixxed (and rightfully so), I may put something out on the forum about it to see what might be able to be done. Otherwise as time allows I will probably try to get the Recordings modification for this back out to you to look at.

(will edit description above as well)