Source

trac-dvbcronrecording-plugin / src / dvbcronrecording / channelsconf.py

Diff from to

File src/dvbcronrecording/channelsconf.py

         
         newchannels_list = self._newchannels_list(cursor, req)
         channels_list = self._channelsconf_list(cursor, req, channeltype)
-        channeltypelist = ["all channel types", "radio channels", "video channels"]
+        channeltypelist = ["all channel types",
+                           "data channels", 
+                           "radio channels", 
+                           "video channels"]
 
         # passing variables to template
         data = {}
         data["channeltype"] = channeltype
         data["channeltypelist"] = channeltypelist
         data['new_datalist'] = newchannels_list
+        data['_selection'] = "channeltype="+quote2(channeltype)
         data["_pagenum"] = req.args.get("_pagenum", "0")
         data["_pagesize"] = req.args.get("_pagesize", "10")
         data['datalist'] = Paginator(channels_list, int(data["_pagenum"]), int(data["_pagesize"]))
     """
       Returns list of the channels.conf
     """
-    def _channelsconf_list(self, cursor, req, type1 = None):
+    def _channelsconf_list(self, cursor, req, channeltype = None):
         view = ['adapter']
         cols = ['adapter', 'title','frequency','polarity','source','symbolrate','vpid', 'apid', 'tpid']
         sql = "SELECT %s FROM recording_channelsconf" % (",".join(cols))
             if req.args.has_key(col):
                 view_vals += [ aff(req.args[col], "recording_channelsconf", col) ]
                 view_cols += [ col ]
-        if type1 in [ "audio", "video", "radio channels", "video channels" ]:
+        if channeltype in [ "audio", "video", "radio channels", "video channels" ]:
             type_cols += ["apid > 0"]
-        if type1 in [ "video", "video channels" ]:
+        elif channeltype in [ "data", "data channels"]:
+            type_cols += ["apid = 0"]
+        if channeltype in [ "video", "video channels" ]:
             type_cols += ["vpid > 0"]
-        elif type1 in [ "audio", "radio channels"]:
+        elif channeltype in [ "audio", "radio channels"]:
             type_cols += ["vpid = 0"]
         if view_cols:
             view_sql = " WHERE " + (" AND ".join([" %s = %%s" % col for col in view_cols ]))