[mythtv] [PATCH] filldatabase corruption of programs with following

Charlie Brej brejc8 at vu.a.la
Mon Jul 5 07:59:16 EDT 2004


This small patch tackles two problems:
The first problem being the programs followed by the news etc. have 
their category, rating... destroyed. The patch preserves the information 
from the first program in the group rather than the last.

The second problem being the database cannot find programs if their 
names have been appended with the names of the following programs. The 
"--dont-append-following" command line option prevents following 
programs from being appended to the title.

This is increasingly annoying as UK channel 5 adds news updates every 
hour or so now with different names: "five news at 9", "five news late", 
"five news update", "five News Update"... And combinations of two or 
more of these. So to record a show by name you have to anticipate the 
news update names and add it to your recording shows.

I didn't add this to the help message as I'm not sure where it would fit.

I think in the future there should be another entry in the database 
listing all the following programs which are programs in their own right 
but only appear in the listings as sub programs to the main program.

The assumption that the first program in the group is the main feature 
should be explored but I thing its a fair assumption to make.
-------------- next part --------------
Index: filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.121
diff -u -r1.121 filldata.cpp
--- filldata.cpp	3 Jul 2004 03:58:41 -0000	1.121
+++ filldata.cpp	5 Jul 2004 11:30:27 -0000
@@ -36,6 +36,7 @@
 bool interactive = false;
 bool channel_preset = false;
 bool non_us_updating = false;
+bool append_following = true;
 bool from_file = false;
 bool quiet = false;
 bool no_delete = false;
@@ -1419,6 +1420,7 @@
     QString aggregatedDesc;
     QString groupingTitle;
     QString groupingDesc;
+    ProgInfo *firstpginfo = NULL; 
 
     QDomNode n = docElem.firstChild();
     while (!n.isNull())
@@ -1468,6 +1470,7 @@
                         /* append all titles/descriptions from one clump */
                         if (pginfo->clumpidx.toInt() == 0)
                         {
+                            firstpginfo = pginfo;
                             aggregatedTitle = "";
                             aggregatedDesc = "";
                         }
@@ -1488,13 +1491,16 @@
                         if (pginfo->clumpidx.toInt() == 
                             pginfo->clumpmax.toInt() - 1)
                         {
-                            pginfo->title = aggregatedTitle;
-                            pginfo->desc = aggregatedDesc;
-                            (*proglist)[pginfo->channel].push_back(*pginfo);
+                            if (append_following) firstpginfo->title = aggregatedTitle;
+                            firstpginfo->desc = aggregatedDesc;
+                            (*proglist)[firstpginfo->channel].push_back(*firstpginfo);
+                            delete firstpginfo;
                         }
+                        if (pginfo->clumpidx.toInt() == 0)
+                            pginfo = NULL;
                     }
                 }
-                delete pginfo;
+                if (pginfo != NULL) delete pginfo;
             }
         }
         n = n.nextSibling();
@@ -3008,6 +3014,10 @@
                 }
             }
         }
+        else if (!strcmp(a.argv()[argpos], "--dont-append-following"))
+        {
+            append_following = false;
+        }
         else if (!strcmp(a.argv()[argpos], "-h") ||
                  !strcmp(a.argv()[argpos], "--help"))
         {


More information about the mythtv-dev mailing list