[mythtv] [patch] remove database errors when start time > end time

Andrew M. Bishop amb at gedanken.demon.co.uk
Sun Jun 6 04:29:03 EDT 2004


Sometimes the data from xmltv is wrong and the start time listed for a
program is later than the end time.  This seems to happen a lot with
the UK bleb.org data.

This patch just ignores any programs where the start time is later
than the end time so that we don't try inserting them into the
database and therefore don't get the errors.

-------------- next part --------------
diff -u /home/amb/mythtv/v0.15.1/mythtv/programs/mythfilldatabase/filldata.cpp\~ /home/amb/mythtv/v0.15.1/mythtv/programs/mythfilldatabase/filldata.cpp
--- /home/amb/mythtv/v0.15.1/mythtv/programs/mythfilldatabase/filldata.cpp~	2004-06-01 02:12:26.000000000 +0100
+++ /home/amb/mythtv/v0.15.1/mythtv/programs/mythfilldatabase/filldata.cpp	2004-06-06 09:20:15.000000000 +0100
@@ -1443,6 +1443,13 @@
                     if (!pginfo->desc.isEmpty())
                         groupingDesc = pginfo->desc + " : ";
                 }
+                else if (pginfo->startts > pginfo->endts)
+                {
+                    cerr << "invalid program (start > end): "
+                         << pginfo->channel << " "
+                         << pginfo->title.local8Bit() << " "
+                         << pginfo->startts << "-" << pginfo->endts << endl;
+                }
                 else
                 {
                     if (pginfo->clumpidx.isEmpty())
-------------- next part --------------

-- 
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop                             amb at gedanken.demon.co.uk
                                      http://www.gedanken.demon.co.uk/


More information about the mythtv-dev mailing list