Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
fletchb
Posts: 10
Joined: Thu Oct 14, 2010 9:46 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by fletchb »

djp952 wrote: Sun Feb 21, 2021 3:23 pm fletchb, you should be good to go now, NickK got on and fixed it for us. (appreciate that, Nick!)

You can bounce Kodi or do a "trigger guide listing update" from the PVR & Live TV Client settings to force the reload.
Just got home and it is working!
Thank you..

djp952
Posts: 1380
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 21

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

fletchb wrote: Sun Feb 21, 2021 7:10 pm
djp952 wrote: Sun Feb 21, 2021 3:23 pm fletchb, you should be good to go now, NickK got on and fixed it for us. (appreciate that, Nick!)

You can bounce Kodi or do a "trigger guide listing update" from the PVR & Live TV Client settings to force the reload.
Just got home and it is working!
Thank you..
I appreciate it, but all thanks should go to Nick and the SiliconDust folks :) I don't think these guys take a day off.

This is, to my knowledge, the first time this has happened, but I'm trying to think of a relatively non-intrusive way to alert about it since it does fail really silently. Perhaps something like if the database is new/empty or consists of all past data and something like this happens to prompt with a message about it to let you know. Most of the time it becomes obvious quickly when something is wrong, like you'll suddenly have no Timers or Recordings, but EPG data is valid for 14 days so it will keep pulling from what it has even if an error is occurring.

I'll think of something; I understand the frustration factor of installing a new Kodi version and having it not work for an unknown reason. Something like this could also happen if the PVR addon database gets updated, it will start out as empty and if it can't reload the data the impression will (correctly) be that there must be a problem with the new version of the addon.

Anyway, very glad it's up and running for you, but I really had nothing to do with fixing it other than mentioning it to SD in the forum. IMO they deserve all the credit for even giving me a way to get EPG data for the DVR subscribers after my addon abused the crap out of their backend (yes, the pun is implied there) for a long time :)

timecutter
Posts: 26
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by timecutter »

dpj952, can you check something when you get time? I changed my kodi skin to display ListItem.Premiered on the guide which should show the release/aired date of the currently selected episode. It does that however it is off by one day which might be a timezone conversion issue. Can you look at the data that you are populating in the epg (epgtag.SetFirstAired(item.originalairdate))? The other dates seem fine, just that one is off a day for me.

database.cpp
xmltv_time_to_w3c(xmltv.date) as originalairdate,

dbextension.cpp
void xmltv_time_to_w3c(sqlite3_context* context, int argc, sqlite3_value** argv)

thanks

signcarver
Expert
Posts: 9527
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 27

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by signcarver »

This has to deal with the time of the original airing date being day of airing at midnight UTC... for the US that causes such to appear to be a day earlier as when it airs in the US in prime time, UTC is on the next day.

For example a show set to premier tonight at 8pm Feb 26 2021 EST the Airdate will be Midnight UTC of February 26 (1614297600) which when translated to EST would be 7pm Feb 25th while locally it first aired at 1614387600 25 hours later (if you are on the west coast same 8pm applies so it would be 28 hours later ). I would disagree to put it different in the database but the app/skin for that field should treat the time in that field as UTC and not convert to local prior to doing its date formatting.

djp952
Posts: 1380
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 21

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Matrix, right?

In the XMLTV data, it's actually a W3C date, not an epoch timestamp. In Leia I had to convert it to a timestamp and the Kodi UI would localize it, but in Matrix the date itself is used, this now allows for dates prior to 1970 to work too, which is nice. I actually worked on the PR to support that: https://github.com/xbmc/xbmc/pull/17192

Part of that PR undid the localization of the date being displayed by Kodi to specifically avoid timezone conversions. You can peek here (https://github.com/xbmc/xbmc/pull/17192 ... 27f1cc7202), note that "FirstAiredAsLocalTime" was replaced with "FirstAired". I checked the current Matrix code, that hasn't changed.

So you should be getting exactly the same date in the UI that came from the XMLTV data, no conversions should be happening.

If you want to save off a copy of your PVR database file (hdhomerundvr-v13.db) and make it available I can make sure nothing wonky is going on. It's a pretty file these days due to the XMLTV cache, so e-mail probably won't work, but they do zip up rather well. If you can provide the date/time/channel/programs you're seeing as being wonky I can confirm it's that way in the XMLTV.

signcarver
Expert
Posts: 9527
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 27

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by signcarver »

Sorry forgot he was looking at guide as I usually don't need to bother with the XML data with most of my utilities... In looking at it, it appears most of the dates (times) are still UTC and the date is day of (though start is "next day") so I do think there still is a timezone conversion being applied to the date when rendered since the times are converted as well but I don't use kodi that often.

timecutter
Posts: 26
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by timecutter »

For Shark Tank on ABC tonight, Epg12.db shows 1614297600 iFirstAired which converts to this:
GMT: Friday, February 26, 2021 12:00:00 AM
Your time zone: Thursday, February 25, 2021 6:00:00 PM

I'll look into getting the skin to show the GMT date instead of my local time.

appreciate the nudge in the proper direction.

timecutter
Posts: 26
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by timecutter »

more on epg12.db - shark tank abc tonight.

Start time: 1614387600
End Time: 1614391260
FirstAired: 1614297600

Looks like they have the start and stop dates as GMT and the date as local date.
Here is the xml coming from https://api.hdhomerun.com/api/xmltv?DeviceAuth=

Code: Select all

<programme start="20210227010000 +0000" stop="20210227020100 +0000" channel="US34664.hdhomerun.com">
		<title>Shark Tank</title>
		<desc lang="en">A product to help make one's bed; a plant-based take on a classic favorite food; an easy way to walk one's dog without tracking dirt and germs; an app designed to help kids learn coding; an update on Flexscreen, a flexible window screen company.</desc>
		<date>20210226</date>
		<category>Series</category>
		<category>Reality</category>
		<language>en</language>
		<icon src="https://img.hdhomerun.com/titles/C3560383ENC529.jpg" width="360" height="270"/>
		<series-id system="cseries">C3560383ENC529</series-id>
		<episode-num system="dd_progid">EP01158129.0270</episode-num>
		<episode-num system="onscreen">S12E15</episode-num>
		<new/>
</programme>

djp952
Posts: 1380
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 21

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Ah so this is Leia, not Matrix, apologies. The code you pasted from the addon must have come from the default "main" branch, which is Matrix. For Leia, let me see what I can do. Getting the time zone offset is one of those things that's harder than it needs to be in a portable way, but I understand the need here and will come up with something :)

Would you mind sharing the skin edit with me so I can test it out?

edit: I'll probably make this an option in case it messes anything unforeseen up in Kodi. I don't think it will, though.

timecutter
Posts: 26
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by timecutter »

What do you think about adding an offset setting for seconds that is defaulted to 0 , could even be hidden so that I have to edit directly in the file.

That would save you from trying to figure out the offset and you could just add the offset setting to the epoch time.

For the skin, this was Estuary skin that I made a copy of and then edited this file.

addons/skin.estuary/xml/MyPVRGuide.xml

Search for:

Code: Select all

<label>$INFO[ListItem.Genre,[COLOR grey]$LOCALIZE[515]:[/COLOR] ]</label>

change to:
<label>$INFO[ListItem.Premiered]</label>
restart kodi and then open the guide. the date will appear above the plot on the right side of the screen.

not a show stopper if nothing can be done.

djp952
Posts: 1380
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 21

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

It's building now, actually. It wasn't nearly as hard as I remembered it being, and I did add ListItem.Premiered to the skin to verify. One note that I will make when it's done building and I can post for you is that you should probably try to handle a ListItem.Premiered value less than January 2, 1970 if conditions are allowed in the skin XML files. While I don't set this field at all if there is no "Original Air Date" or it won't make sense (Movies/News/etc), Kodi will still default this value to zero on you and localize it appropriately when you ask for it via ListItem.Premiered. West of UTC Kodi will indicate "December 31, 1969", East of or in UTC Kodi will indicate "January 1, 1970".

When I post, I will also include a link for you to be able to code review it.

I'll note this in the post, but there is also a fairly significant change that will be in this that requires documentation and explanation. It required a PR to be requested against Kodi Matrix/"N" to really work properly, and since Leia is dead now if it will cause too many problems it will probably just be removed from that platform.

djp952
Posts: 1380
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD USA
x 21

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 »

Here you go timecutter ... see if this fixes your Leia skin update :)

Version v3.5.0~alpha1 - build 7727 - 2021.02.26 (LEIA ONLY)
  • Update cURL library to version 7.75.0
  • Fix race condition that could cause a "Database is locked" error to be logged during Kodi startup
  • Fix bug that could cause unnecessary triggering of both channel and channel group updates
  • Add "Enable Radio channel mappings" and "Radio channel mapping file" advanced options
  • (Leia) Adjust reported Electronic Program Guide (EPG) original air values based on the system time zone
CAUTION: This is an Alpha release for Leia; there is a significant change that may or may not ultimately work right on this platform. I have issued a PR to Kodi in an attempt to make it work to my satisfaction on Matrix, but Leia is a dead platform at this point. If it doesn't seem to work well enough it will likely be removed from Leia.

Add "Enable Radio channel mappings" and "Radio channel mapping file" advanced options
This should be considered as experimental on Leia and requires explanation/documentation to support it; please do not enable this right now as I am not prepared to do those task(s).

(Leia) Adjust reported Electronic Program Guide (EPG) original air values based on the system time zone
This Leia-specific change modifies the original air date timestamp reported to Kodi for EPG data so that it's adjusted properly for the system time zone. If this value was accessed via a Leia skin change, Kodi will try to adjust it for the local time zone instead of UTC. Users west of UTC (Greenwich, England, UK) would see this reported as one day earlier than it should be. NOTE: By default Kodi 18 "Leia" doesn't really use this value and I do not expect this change to cause any problems. It was not made optional as was alluded to earlier in this thread; it's unilateral.
CODE REVIEW: https://github.com/djp952/pvr.hdhomerun ... b2941416e5

Download (LEIA ONLY) (OneDrive): https://1drv.ms/u/s!AgEGEEVzGNq-jJhJhXj ... Q?e=szvH7r

Installing an ~alphaX or ~betaX release on your system does not exclude you from auto-updates. Kodi detects and handles both "~alpha" and "~beta" versions and will treat them as "less" than a version without those tags.

Please let me know if this fixes the problem.

Ken.F
Posts: 2362
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA
x 8

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F »

djp952 wrote: Fri Feb 26, 2021 10:04 pm Add "Enable Radio channel mappings" and "Radio channel mapping file" advanced options
This should be considered as experimental on Leia and requires explanation/documentation to support it; please do not enable this right now as I am not prepared to do those task(s).
You're such a tease. :)
Is this your pvr.rtlradio?

timecutter
Posts: 26
Joined: Mon Aug 20, 2018 5:12 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by timecutter »

yes - that appears to have fixed it for one channel only, guessing that you limited it to one channel for testing purposes.

reverted back to 3.4.1 restored the full guide. Again - I GREATLY APPRECIATE YOU for this.

Post Reply