Came across a couple bugs while trying to get this working. Basically, taking listings grabbed using tv_grab_dvb caused trouble. Presumably other XMLTV sources could stumble over some of these.
a) parser crashes when importing XMLTV if source-data-url isn't set.
b) parser crashes because it can't parse the dates (from tv_grab_dvb).
c) parser reads data incorrectly, resulting in incomplete program name and description details, both in the XMLTV parser, and in the internal parser.
d) parser ignored programme description information.
This patch addresses:
a) checking for null source-data-url, and hardcoding "T" if so. Choice is pretty arbitrary, but seemed neater than something like "Unspecified".
b) pulled part of the code from the freeguide-tv project to handle date, however, because they do things slightly differently, I didn't pinch all of it, and this means that the "yyyyMMddHHmmss Z" format won't work anymore. I don't know enough about String.matches() to figure out a suitable test to keep that working... Maybe I'm just too tired...
c) when characters happens multiple times during the same programme element, the old code overwrote whatever was discovered earlier with whatever was discovered later, resulting in only getting the last part of the text. Changed both the XMLTV and internal parsers to spot this case, and append the new data rather than overwrite it. Probably this isn't the "correct" way to do it (freeguide seems to use endElement to get description and names), but it seems to work just fine...
d) copied code from the title handling stuff, and now have descriptions...
Sorry, some of the indenting is a little out...
--
Regards, Iainwt@users.source...(OK, I've forgotten my password, and it's 1:40 in the morning).
diff -ruwb