I realise that XMLTV is a standard.
https://github.com/XMLTV/xmltv/blob/master/xmltv.dtd
I realise that what I am suggesting does not fit within that standard, however......
My primary EPG source comes from a third party that produce curated and enhanced EPG information for my region. They already provide a number of non-standard nodes and attributes within the XMLTV that they feed to TVHeadEnd. At the moment, TVH just ignores it. I would like to try to take advantage of that extra data if I can.
Currently, the TVH XMLTV EPG import module has a list of hard-coded nodes and attributes that it parses and then saves into the EPG database.
I am proposing that the TVH XMLTV import module be enhanced to handle the processing of XPath references. https://en.wikipedia.org/wiki/XPath
With XPath, it should be possible to identify specific nodes or attributes that may contain useful EPG information. Once the standard XMLTV parsing has taken place, a list of XPath references could then be examined in order to extract additional EPG information to be saved in the TVH EPG database.
The TVH EPG database has many fields that are not populated from an XMLTV source because they are not part of the XMLTV standard. These could be fields like the episode or series CRID, repeat flags, etc.
EPG Event Unique Identifier
With OTA DVB EIT data, each EPG event for a channel is allocated a unique ID. When changes are received, the event is matched using the ID and then saved to the TVH EPG database.
XMLTV has no such unique identifier. As such, the XMLTV module will try to match the channel+start+end to identify the event. For instances where the change is to the start time and/or duration, no match is found, the original event is abandoned and a new event created in its place.
This is not an issue for events that are not being recorded, however, if an even is scheduled to be recorded, it becomes an orphan and does not receive EPG updates.
I’m proposing that the TVH EPG database be expanded to include an external identifier field that can be used for XMLTV even matching.
An XPath reference will look for this field BEFORE the standard XMLTV parsing in order to obtain a match for updated events.
Other Fields
For each TVH EPG database field that XMLTV does not support, provide an area in the WebUI to add an XPath reference that will be used to search for that data. I am currently reconciling the data available from XMLTV to the fields present in the TVH EPG database.
Non XPath Enhancement - Genre/Content Identifier.
Currently, in order to match the genre, the complete genre text needs to be matched, for example, ‘informational/educational/school programmes’.
Within the OTA DVB EIT data, however, a set of numeric codes are used for a list of preset descriptions, not the full text. For example, the code for the category above is 0x54. The ‘0x’ simply indicates that a base 16 (hexadecimal) value is being used.
I would like to propose that if the XMLTV parser encounters a genre description text beginning with ‘0x’, it should be interpreted as a code and not description text. These codes are identical for all languages.
Thoughts and constructive comments welcome.