[mythtv] mythfilldatabase bug

Kyle Rose krose+mythtv at krose.org
Thu Apr 22 23:42:34 EDT 2004


Since I started using tv_grab_na_dd, mythfilldatabase no longer
creates/updates the identical channels (as identified by xmltvid) on
my second video source.  This patch fixes that problem by adding an
extra clause to the left join conditional in DataDirectStationUpdate:

Index: filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.102
diff -u -r1.102 filldata.cpp
--- filldata.cpp        21 Apr 2004 03:23:33 -0000      1.102
+++ filldata.cpp        23 Apr 2004 03:39:27 -0000
@@ -223,15 +223,16 @@
 
     ddprocessor.updateStationViewTable();
 
-    querystr = "SELECT dd_v_station.stationid,dd_v_station.callsign,"
+    QSqlQuery query1;
+    query1.prepare("SELECT dd_v_station.stationid,dd_v_station.callsign,"
                "dd_v_station.stationname,dd_v_station.channel "
                "FROM dd_v_station LEFT JOIN channel ON "
                "dd_v_station.stationid = channel.xmltvid "
-               "WHERE channel.chanid IS NULL;";
-
-    QSqlQuery query1;
+               "AND channel.sourceid = :SOURCEID "
+               "WHERE channel.chanid IS NULL;");
+    query1.bindValue(":SOURCEID", source.id);
 
-    if (!query1.exec(querystr))
+    if (!query1.exec())
         MythContext::DBError("Selecting new channels", query1);
 
     if (query1.isActive() && query1.numRowsAffected() > 0)

Cheers,
Kyle


More information about the mythtv-dev mailing list