[mythtv] mythfilldatabase second DD source problem

Kyle Rose krose+mythtv at krose.org
Fri May 14 17:09:48 EDT 2004


I sent this a few weeks back, but heard nothing.  As far as I can
tell, this problem still exists.

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: programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.105
diff -u -r1.105 filldata.cpp
--- programs/mythfilldatabase/filldata.cpp      14 May 2004 02:41:37 -0000      1.105
+++ programs/mythfilldatabase/filldata.cpp      14 May 2004 21:07:06 -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