- October 23, 2015
- 10
- 0
- Home Country
- United States of America
I would like support for parsing the <new /> tag in <programme> blocks in XmlTV EPG data in order to set the original air date meta-data for a program when that program's <programme> block does not have a <date> tag.
I believe this could be easily achieved by simply adding the following code to the switch block that parses XmlTV tags in the TVEngine.XMLTVImport.Import() function, around lines 430 to 490 in XMLTVImport.cs
case "new":
if (nodeDate == null && nodeStart != null && nodeStart.Length > 7) nodeDate = nodeStart.Substring(0, 8);
else xmlProg.Skip();
break;
I haven't tried testing this code myself, but in theory it should work. In the case that the <programme> block contains both a <date> tag and a <new /> tag, the <date> tag would override the <new /> or vice-versa, depending on which comes first.
In my experience looking over XmlTV files obtained by mc2xml, the <new /> tag always seems to be the very last tag in the <programme> block whenever the program is new, and when it is there, the <date> tag is missing, and hence the original air date of many programs is often missing from the EPG data, a critical piece of data needed for setting automated recordings of new episodes of TV shows, and being able to visually determine whether an episode is new when manually scheduling recordings.
I believe this could be easily achieved by simply adding the following code to the switch block that parses XmlTV tags in the TVEngine.XMLTVImport.Import() function, around lines 430 to 490 in XMLTVImport.cs
case "new":
if (nodeDate == null && nodeStart != null && nodeStart.Length > 7) nodeDate = nodeStart.Substring(0, 8);
else xmlProg.Skip();
break;
I haven't tried testing this code myself, but in theory it should work. In the case that the <programme> block contains both a <date> tag and a <new /> tag, the <date> tag would override the <new /> or vice-versa, depending on which comes first.
In my experience looking over XmlTV files obtained by mc2xml, the <new /> tag always seems to be the very last tag in the <programme> block whenever the program is new, and when it is there, the <date> tag is missing, and hence the original air date of many programs is often missing from the EPG data, a critical piece of data needed for setting automated recordings of new episodes of TV shows, and being able to visually determine whether an episode is new when manually scheduling recordings.
Last edited: