XMLTV guide data

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
djp952
Posts: 1058
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: XMLTV guide data

Post by djp952 » Fri Dec 06, 2019 2:48 pm

nickk wrote:
Fri Dec 06, 2019 9:38 am
Added series-id tag (non-standard) and star-rating tag (standard).

Nick
Thank you Nick!

It looks like Movies (MV) aren't being assigned a <series-id> tag, is that expected? It appears on the surface this can be generated by simply removing the "." from the dd_progid value for these items, should I go that route or is this a glitch?

nickk
Silicondust
Posts: 15674
Joined: Tue Jan 13, 2004 9:39 am

Re: XMLTV guide data

Post by nickk » Fri Dec 06, 2019 7:04 pm

No problem... series id added for movies.

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

Re: XMLTV guide data

Post by djp952 » Sat Dec 07, 2019 9:31 pm

First, thank you for adding <series-id> for Movies :)

I've run into a problem with the <channel> elements ... There is a duplicate id attribute in the data retrieved for my authorization codes. I see "US86442.hdhomerun.com" twice, which will ultimately associate all listings for the second channel back to the first channel instead:

First instance:

Code: Select all

	<channel id="US86442.hdhomerun.com">
		<display-name>WFDCDT3</display-name>
		<display-name>464 WFDCDT3</display-name>
		<display-name>464 WFDC GETTV</display-name>
		<display-name>464</display-name>
		<display-name>WFDC GETTV</display-name>
		<display-name>GRIT</display-name>
		<icon src="http://img.hdhomerun.com/channels/US86442.png" width="360" height="270"/>
	</channel>
Second instance:

Code: Select all

	<channel id="US86442.hdhomerun.com">
		<display-name>WFDCDT3</display-name>
		<display-name>485 WFDCDT3</display-name>
		<display-name>485 WFDC GRIT</display-name>
		<display-name>485</display-name>
		<display-name>WFDC GRIT</display-name>
		<display-name>GRIT</display-name>
		<icon src="http://img.hdhomerun.com/channels/US86442.png" width="360" height="270"/>
	</channel>
This is undoubtedly a source data problem, but it will be difficult to process the <channel> elements accurately without some level of referential integrity. Is there anything you might be able to do in the API to prevent duplicate <channel> id values?

Device IDs are listed in my profile, please feel free to interrogate them as necessary!

Thank you!

garyan2
Posts: 42
Joined: Sun Aug 19, 2018 9:36 am
Contact:

Re: XMLTV guide data

Post by garyan2 » Sat Dec 07, 2019 9:58 pm

There's been a little discussion on this already. I must say, I am fundamentally against creating unique IDs for each channel and instead use the unique ID for the station assigned to the channel. This makes the XMLTV file more efficient for simply not repeating the same schedule 2, 3, or even 4 times for a single station... and then doing that for 20 or 30 or more stations. That is a lot of duplicated information.

EPG123 overloads the channel element with all channel numbers that the station is transmitted on, but that has some negatives. Mainly, I don't know and can't control how the consuming program handles overloads, if at all. I didn't want to create multiple channels with the same ID due to concern the consuming program will only pick up one of them and ignore the rest. There is some elegance though, for just its simplicity, in creating multiple channels with the same ID.

For your situation, being able to create rules based on channel number as well as station id, could you create a UID for each channel internally by concatenating the channel number and the channel ID?

My method of consuming an XMLTV for WMC can handle any method that is decided upon. I am also considering changing the XMLTV output of EPG123 to be what SD is doing right now with multiple channels with the same ID. None of the external programs that have imported my XMLTV has been able to handle the overload, so I don't have much to lose.

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

Re: XMLTV guide data

Post by djp952 » Sun Dec 08, 2019 6:28 am

I agree in principal. It's just a different mindset than before and can be worked with easily enough. Instead of having programming relating back to a single channel it can now relate back to multiple channels. If the data is stored (even if temporarily) and can be referenced it wouldn't be difficult to answer the question "what channel(s) is this program available on".

I was creating schema from the XMLTV DTD, which states:

Code: Select all

Each channel has one id attribute, which must be unique
Duplication of ids could also be an indicator to the backend that the guide data for the user's area/provider needs a tweak without the user needing to report it. That's what wrong in my case, one of the two channels has the incorrect listings.

garyan2
Posts: 42
Joined: Sun Aug 19, 2018 9:36 am
Contact:

Re: XMLTV guide data

Post by garyan2 » Sun Dec 08, 2019 12:41 pm

djp952 wrote:
Sun Dec 08, 2019 6:28 am
I was creating schema from the XMLTV DTD, which states:

Code: Select all

Each channel has one id attribute, which must be unique
Which is why I opted to include all channel numbers a station was broadcast on in the <display-name> elements of a single <channel> for EPG123... it was my compromise on file size and compliance to the DTD. Unfortunately, I haven't found any consumers that can handle multiple channel numbers. Only 1 of the channel numbers (first/last) would get recognized.

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

Re: XMLTV guide data

Post by djp952 » Sun Dec 08, 2019 1:02 pm

It really didn't turn out to be a problem for me. I just had to add a level of indirection to go through the channels to get to the listings instead of iterating the listings directly. No big deal in the end!

garyan2
Posts: 42
Joined: Sun Aug 19, 2018 9:36 am
Contact:

Re: XMLTV guide data

Post by garyan2 » Mon Dec 09, 2019 7:47 pm

nickk wrote:
Fri Dec 06, 2019 9:38 am
Added series-id tag (non-standard) and star-rating tag (standard).

Nick
I was actually grabbing star ratings from the movie description since it is embedded at the end of it. Added my code to get it from the new star-rating element and it fell flat.

Star-rating isn't compliant to the dtd... should be:

Code: Select all

<star-rating system="something">
  <value>3.0/4.0</value>
  <icon>some image path</icon>
</star-rating>
EDIT: of course, only need the <value> element, don't need the icon and system attribute.

nickk
Silicondust
Posts: 15674
Joined: Tue Jan 13, 2004 9:39 am

Re: XMLTV guide data

Post by nickk » Mon Dec 09, 2019 8:20 pm

Star rating - fixed.

nickk
Silicondust
Posts: 15674
Joined: Tue Jan 13, 2004 9:39 am

Re: XMLTV guide data

Post by nickk » Wed Dec 11, 2019 5:46 pm

Added lcn element to indicate the virtual channel number.

Nick

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

Re: XMLTV guide data

Post by djp952 » Wed Dec 11, 2019 9:09 pm

nickk wrote:
Wed Dec 11, 2019 5:46 pm
Added lcn element to indicate the virtual channel number.

Nick
Thanks! Adapted. Saves iterating the list of <display-name> elements. Every millisecond counts :)

nickk
Silicondust
Posts: 15674
Joined: Tue Jan 13, 2004 9:39 am

Re: XMLTV guide data

Post by nickk » Wed Dec 11, 2019 9:31 pm

Added progType to category list. This give you Sports event, Series, etc.

garyan2
Posts: 42
Joined: Sun Aug 19, 2018 9:36 am
Contact:

Re: XMLTV guide data

Post by garyan2 » Wed Dec 11, 2019 9:40 pm

Perfect! That was the last thing I needed before a release and works as expected.

Thank you, Nick!

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

Re: XMLTV guide data

Post by djp952 » Thu Dec 12, 2019 6:07 pm

nickk wrote:
Wed Dec 11, 2019 9:31 pm
Added progType to category list. This give you Sports event, Series, etc.
This one dorked me up a little, will the second <category> element now always be the TMS-style genre string? These types of things are my main problem with XMLTV, too many multi-valued child elements without attributes to identify them :)

I'm about ready to "go live", as it were, code is in public beta. Do you anticipate any additional breaking changes to the XML layout and element order from this point forward?

nickk
Silicondust
Posts: 15674
Joined: Tue Jan 13, 2004 9:39 am

Re: XMLTV guide data

Post by nickk » Thu Dec 12, 2019 7:34 pm

It is handled as a set so I think the category output is in alphabetical order.

I might be able to add an attribute - let me check...

Nick

Post Reply