[mythtv] Patch: update channum and freqid in DataDirect

henri henri at qais.com
Thu Dec 16 19:45:52 UTC 2004


missed a few shows because cox-phoenix (arizona) did a
channel-shuffle between TBS and UPN (and "COX9"). so all the
UPN show recordings actually recorded on TBS :(

this patch adds updating the channum and freqid using
datadirect. "lightly" tested.

going to a backup of the db it looked like this:

+--------+---------+--------+----------+
| chanid | channum | freqid | callsign |
+--------+---------+--------+----------+
|   1016 | 16      | 16     | KUTP     |
+--------+---------+--------+----------+

after running mythfilldatabase i have:

+--------+---------+--------+----------+
| chanid | channum | freqid | callsign |
+--------+---------+--------+----------+
|   1016 | 9       | 9      | KUTP     |
+--------+---------+--------+----------+


henri
-------------- next part --------------
Index: programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.137
diff -u -3 -p -r1.137 filldata.cpp
--- programs/mythfilldatabase/filldata.cpp	25 Nov 2004 06:45:48 -0000	1.137
+++ programs/mythfilldatabase/filldata.cpp	16 Dec 2004 19:29:32 -0000
@@ -758,20 +758,22 @@ void DataDirectStationUpdate(Source sour
 
     // Now, update the data for channels which do exist
 
-    QSqlQuery dd_station_info("SELECT callsign, stationname, stationid"
+    QSqlQuery dd_station_info("SELECT callsign, stationname, channel, stationid"
             " FROM dd_v_station;");
 
     if (dd_station_info.first())
     {
         QSqlQuery dd_update;
         dd_update.prepare("UPDATE channel SET callsign = :CALLSIGN,"
-                " name = :NAME WHERE xmltvid = :STATIONID"
-                " AND sourceid = :SOURCEID;");
+                " name = :NAME, channum = :CHANNEL, freqid = :FREQID"
+                " WHERE xmltvid = :STATIONID AND sourceid = :SOURCEID;");
         do
         {
             dd_update.bindValue(":CALLSIGN", dd_station_info.value(0));
             dd_update.bindValue(":NAME", dd_station_info.value(1));
-            dd_update.bindValue(":STATIONID", dd_station_info.value(2));
+            dd_update.bindValue(":CHANNEL", dd_station_info.value(2));
+            dd_update.bindValue(":FREQID", dd_station_info.value(2));
+            dd_update.bindValue(":STATIONID", dd_station_info.value(3));
             dd_update.bindValue(":SOURCEID", source.id);
             if (!dd_update.exec())
             {


More information about the mythtv-dev mailing list