[mythtv] [PATCH] MythVideo - Hide childID videos

Jeff Doozan mythtv at doozan.com
Sun Sep 7 11:36:48 EDT 2003


This patch will hide videos that are set as continuations of other 
videos using the ChildID field in the database.

I use the ChildID to specify multiple parts of the same video 
(CD1/CD2), so I don't need to see CD2 listed in the tree/browser.

-- Jeff

-------------- next part --------------
Index: mythvideo/mythvideo/videotree.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videotree.cpp,v
retrieving revision 1.16
diff -u -r1.16 videotree.cpp
--- mythvideo/mythvideo/videotree.cpp	5 Sep 2003 18:54:08 -0000	1.16
+++ mythvideo/mythvideo/videotree.cpp	7 Sep 2003 14:28:14 -0000
@@ -302,7 +308,13 @@
         //  widget that handles navigation
         //
 
-        QSqlQuery query("SELECT intid FROM videometadata ;", db);
+        QSqlQuery query("SELECT t2.intid " \
+                        "FROM videometadata as t1 " \
+                        "RIGHT JOIN videometadata as t2 " \
+                        "ON t1.childid = t2.intid " \
+                        "WHERE t1.childid is NULL;"
+                        , db);
+
         Metadata *myData;
     
         if(!query.isActive())
Index: mythvideo/mythvideo/videobrowser.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythvideo/mythvideo/videobrowser.cpp,v
retrieving revision 1.15
diff -u -r1.15 videobrowser.cpp
--- mythvideo/mythvideo/videobrowser.cpp	5 Sep 2003 18:54:08 -0000	1.15
+++ mythvideo/mythvideo/videobrowser.cpp	7 Sep 2003 14:28:14 -0000
@@ -212,7 +212,16 @@
     updateML = true;
     m_list.clear();
 
-    QSqlQuery query("SELECT intid FROM videometadata WHERE browse = 1 ORDER BY title;", db);
+    QSqlQuery query("SELECT t2.intid " \
+                    "FROM videometadata as t1 " \
+                    "RIGHT JOIN videometadata as t2 " \
+                    "ON t1.childid = t2.intid " \
+                    "WHERE t1.childid is NULL " \
+                    "AND t2.browse = 1 " \
+                    "ORDER BY t2.title;"
+                    , db);
+
+
     Metadata *myData;
 
     if (query.isActive() && query.numRowsAffected() > 0)


More information about the mythtv-dev mailing list