[mythtv] mythfilldatabase bug

Ove Kaaven ovehk at ping.uio.no
Sat Apr 24 12:25:17 EDT 2004


It seems to me that the logic for --no-delete in mythfilldatabase is
reversed; when the flag is absent, it does not delete old entries for
me, but probably will if it's present. How about either something like
this (untested change):

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	24 Apr 2004 16:19:16 -0000
@@ -1510,7 +1510,7 @@
             if ("" == (*i).stars)
                 (*i).stars = "0";
 
-            if (no_delete)
+            if (!no_delete)
             {
                 querystr.sprintf("SELECT * FROM program WHERE chanid=%d AND "
                                  "starttime=\"%s\" AND endtime=\"%s\" AND "


or perhaps this is better (also untested):

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	24 Apr 2004 16:24:13 -0000
@@ -1528,7 +1528,9 @@
 
                 if (query.isActive() && query.numRowsAffected() > 0)
                     continue;
-
+            }
+            else
+            {
                 querystr.sprintf("SELECT title,subtitle,starttime,endtime "
                                  "FROM program WHERE chanid=%d AND "
                                  "starttime>=\"%s\" AND starttime<\"%s\";",

Either way, perhaps someone should look at it.




More information about the mythtv-dev mailing list