Index: mythplugins/mythweb/modules/tv/search.php
===================================================================
--- mythplugins/mythweb/modules/tv/search.php	(revision 20462)
+++ mythplugins/mythweb/modules/tv/search.php	(working copy)
@@ -205,14 +205,6 @@
                                     .'program.originalairdate<='.$db->escape(date('Y-m-d', $tmpdate)).')';
                 }
             }
-        // HDTV only?
-            if ($_SESSION['search']['hd'])
-                $extra_query[] = 'program.hdtv & 1';
-            if ($_SESSION['search']['generic'])
-                $extra_query[] = 'program.generic = 0';
-        // Commercial-free channels only?
-            if ($_SESSION['search']['commfree'])
-                $extra_query[] = 'channel.commmethod=-2';
         // Build the actual search query
             $query = '';
             foreach ($_SESSION['search']['as'] as $i => $string) {
@@ -307,6 +299,16 @@
             $query   = implode(' OR ', $query);
         }
 
+    // HDTV only?
+        if ($_SESSION['search']['hd'])
+            $extra_query[] = 'program.hdtv & 1';
+    // Ignore generic program listings?
+        if ($_SESSION['search']['generic'])
+            $extra_query[] = 'program.generic = 0';
+    // Commercial-free channels only?
+        if ($_SESSION['search']['commfree'])
+            $extra_query[] = 'channel.commmethod=-2';
+
     // Finish the query and add any extra parameters
         if ($query)
             $query = "($query)";
