[mythtv] Patch for mythfilldatabase --no-delete

Andrew M. Bishop amb at gedanken.demon.co.uk
Sun Feb 27 09:13:42 UTC 2005


Somewhere between version 0.16 and version 0.17 the code for the
--no-delete option to mythfilldatabase was changed.  The use of the
no_delete variable was inverted in one of the if() statements.

The first of the two attached patches (mythfilldatabase.patch1.diff)
fixes this.  Without the fix there are thousands of sql insert errors
and the database ends up with overlapping programs.  It might have
been changed this way for a reason rather than in error, in that case
you might want to consider making this code run for both options.

The second patch (mythfilldatabase.patch2.diff) corrects a minor error
in the checking for unchanged programs.  The sql statement to check
for an unchanged program doesn't use .utf8() on some of the arguments
that the insert sql statement does.  This might lead to some changes
being identified when the database is identical.

-------------- next part --------------
--- /home/amb/mythtv/v0.17/mythtv-0.17/programs/mythfilldatabase/filldata.cpp~	2005-02-09 21:35:13.000000000 +0000
+++ /home/amb/mythtv/v0.17/mythtv-0.17/programs/mythfilldatabase/filldata.cpp	2005-02-27 08:59:13.000000000 +0000
@@ -2279,7 +2279,7 @@
                 continue;
             }
 
-            if (!no_delete)
+            if (no_delete)
             {
                 query.prepare("SELECT title,starttime,endtime FROM program WHERE "
                               "chanid=:CHANID AND starttime>=:START AND "
-------------- next part --------------
--- /home/amb/mythtv/v0.17/mythtv-0.17/programs/mythfilldatabase/filldata.cpp~	2005-02-09 21:35:13.000000000 +0000
+++ /home/amb/mythtv/v0.17/mythtv-0.17/programs/mythfilldatabase/filldata.cpp	2005-02-27 08:59:13.000000000 +0000
@@ -2256,8 +2256,8 @@
             query.bindValue(":DESC", (*i).desc.utf8());
             query.bindValue(":CATEGORY", (*i).category.utf8());
             query.bindValue(":CATEGORY_TYPE", (*i).catType.utf8());
-            query.bindValue(":AIRDATE", (*i).airdate);
-            query.bindValue(":STARS", (*i).stars);
+            query.bindValue(":AIRDATE", (*i).airdate.utf8());
+            query.bindValue(":STARS", (*i).stars.utf8());
             query.bindValue(":PREVIOUSLYSHOWN", (*i).previouslyshown);
             query.bindValue(":TITLE_PRONOUNCE", (*i).title_pronounce.utf8());
             query.bindValue(":STEREO", (*i).stereo);
-------------- 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