From 20f7e3c8e7cb7aa85de9e0e658408f3ee077cc71 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 22 Aug 2013 16:51:53 +0100 Subject: [PATCH] channel: provide a link in the channel grid to allow playback. --- src/channels.h | 2 +- src/webui/static/app/chconf.js | 10 +++++++++- src/webui/static/app/idnode.js | 9 +++++++-- src/webui/webui.c | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/channels.h b/src/channels.h index bb86f4d0..e96f956d 100644 --- a/src/channels.h +++ b/src/channels.h @@ -129,7 +129,7 @@ void channel_delete(channel_t *ch); channel_t *channel_find_by_name(const char *name); #define channel_find_by_uuid(u)\ - (channel_t*)idnode_find(NULL, &channel_class) + (channel_t*)idnode_find(u, &channel_class) channel_t *channel_find_by_id(uint32_t id); diff --git a/src/webui/static/app/chconf.js b/src/webui/static/app/chconf.js index d04be40b..cad62d7d 100644 --- a/src/webui/static/app/chconf.js +++ b/src/webui/static/app/chconf.js @@ -486,6 +486,14 @@ tvheadend.channel_tab = function(panel) titleP : 'Channels', add : false, del : false, - tbar : [ mapButton ] + tbar : [ mapButton ], + lcol : [ + { + header : 'Play', + renderer : function (v, o, r) { + return "Play"; + } + } + ] }); } diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index ed59c491..179fb563 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -410,7 +410,7 @@ tvheadend.idnode_grid = function(panel, conf) { function build (d) { - var columns = []; + var columns = conf.lcol || []; var filters = []; var fields = []; var buttons = []; @@ -420,7 +420,7 @@ tvheadend.idnode_grid = function(panel, conf) var delBtn = null; var editBtn = null; - /* Process */ + /* Process model */ for (i = 0; i < d.length; i++) { var f = d[i]; var type = 'string'; @@ -460,6 +460,11 @@ tvheadend.idnode_grid = function(panel, conf) }); } + /* Right-hand columns */ + if (conf.rcol) + for (i = 0; i < conf.rcol.length; i++) + columns.push(conf.rcol[i]) + /* Filters */ var filter = new Ext.ux.grid.GridFilters({ encode : true, diff --git a/src/webui/webui.c b/src/webui/webui.c index 1e17c8d2..b2502c32 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -513,7 +513,7 @@ page_http_playlist(http_connection_t *hc, const char *remain, void *opaque) if(nc == 2 && !strcmp(components[0], "channelid")) ch = channel_find_by_id(atoi(components[1])); else if(nc == 2 && !strcmp(components[0], "channel")) - ch = channel_find_by_name(components[1]); + ch = channel_find(components[1]); else if(nc == 2 && !strcmp(components[0], "dvrid")) de = dvr_entry_find_by_id(atoi(components[1])); else if(nc == 2 && !strcmp(components[0], "tagid"))