]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Some simple display and configuration of brand based series link configuration.
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 8 Jun 2012 14:33:48 +0000 (15:33 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 30 Jul 2012 14:47:53 +0000 (15:47 +0100)
src/webui/extjs.c
src/webui/static/app/dvr.js
src/webui/static/app/epg.js

index f6c73a754c6928588948c6f517a48970a74b3fd9..a795f9558655d7fbbba86ec99dbece02997c70bb 100644 (file)
@@ -545,7 +545,6 @@ extjs_epggrab(http_connection_t *hc, const char *remain, void *opaque)
     return HTTP_STATUS_BAD_REQUEST;
   }
 
-  htsmsg_print(out);
   htsmsg_json_serialize(out, hq, 0);
   htsmsg_destroy(out);
   http_output_content(hc, "text/x-json; charset=UTF-8");
@@ -829,6 +828,34 @@ extjs_epgrelated(http_connection_t *hc, const char *remain, void *opaque)
   return 0;
 }
 
+static int
+extjs_epgobject(http_connection_t *hc, const char *remain, void *opaque)
+{
+  htsbuf_queue_t *hq = &hc->hc_reply;
+  const char *op = http_arg_get(&hc->hc_req_args, "op");
+  htsmsg_t *out, *array;
+
+  if(op == NULL)
+    return 400;
+
+  if (!strcmp(op, "brandList")) {
+    out   = htsmsg_create_map();
+    pthread_mutex_lock(&global_lock);
+    array = epg_brand_list();
+    pthread_mutex_unlock(&global_lock);
+    htsmsg_add_msg(out, "entries", array);
+
+  } else {
+    return HTTP_STATUS_BAD_REQUEST;
+  }
+
+  htsmsg_json_serialize(out, hq, 0);
+  htsmsg_destroy(out);
+  http_output_content(hc, "text/x-json; charset=UTF-8");
+
+  return 0;
+}
+
 /**
  *
  */
@@ -1628,6 +1655,7 @@ extjs_start(void)
   http_path_add("/confignames", NULL, extjs_confignames, ACCESS_WEB_INTERFACE);
   http_path_add("/epg",         NULL, extjs_epg,         ACCESS_WEB_INTERFACE);
   http_path_add("/epgrelated",  NULL, extjs_epgrelated,  ACCESS_WEB_INTERFACE);
+  http_path_add("/epgobject",   NULL, extjs_epgobject,   ACCESS_WEB_INTERFACE);
   http_path_add("/dvr",         NULL, extjs_dvr,         ACCESS_WEB_INTERFACE);
   http_path_add("/dvrlist",     NULL, extjs_dvrlist,     ACCESS_WEB_INTERFACE);
   http_path_add("/ecglist",     NULL, extjs_ecglist,     ACCESS_WEB_INTERFACE);
index 74de7cf267df3de7bc49443792708b111f0d6da3..0647ba41d09c7fe34956093e448939240f40feef 100644 (file)
@@ -446,6 +446,19 @@ tvheadend.autoreceditor = function() {
                emptyText: 'Only include channel...'
            })
        },{
+    header : "Brand",
+    dataIndex: 'brand',
+    editor : new Ext.form.ComboBox({
+      loadingText: 'Loading...',
+      displayField: 'title',
+      valueField: 'uri',
+      store: tvheadend.brands,
+      mode: 'local',
+      editable: false,
+      triggerAction: 'all',
+      emptyText: 'Record brand...'
+    })
+  },{
            header: "Channel tag",
            dataIndex: 'tag',
            editor: new Ext.form.ComboBox({
@@ -622,7 +635,7 @@ tvheadend.dvr = function() {
 
     
     tvheadend.autorecRecord = Ext.data.Record.create([
-       'enabled','title','channel','tag','creator','contentgrp','comment',
+       'enabled','title', 'brand', 'channel','tag','creator','contentgrp','comment',
        'weekdays', 'pri', 'approx_time', 'config_name'
     ]);
     
index 2c8e5e8cd8d7bb51cb77d2f2f00e8e7634f920b2..be30ccf6332ff510187d995e93539e8fbf41f1d4 100644 (file)
@@ -1,3 +1,13 @@
+tvheadend.brands = new Ext.data.JsonStore({
+  root: 'entries',
+  // TODO: this is not ALL fields, just those that I'm likely to use here
+  fields: [ 'uri', 'title' ],
+  autoLoad: true,
+  url : 'epgobject',
+  baseParams : { op : 'brandList' }
+});
+// TODO: we might want this to periodically update!
+
 tvheadend.ContentGroupStore = new Ext.data.JsonStore({
     root:'entries',
     fields: [{name: 'name'}],