channel: provide a link in the channel grid to allow playback.

This commit is contained in:
Adam Sutton 2013-08-22 16:51:53 +01:00
parent 65c304fb9a
commit 20f7e3c8e7
4 changed files with 18 additions and 5 deletions

View file

@ -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);

View file

@ -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 "<a href='stream/channel/" + r.id + "'>Play</a>";
}
}
]
});
}

View file

@ -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,

View file

@ -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"))