diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js index 0e45efe1..4debd557 100644 --- a/src/webui/static/app/dvr.js +++ b/src/webui/static/app/dvr.js @@ -90,7 +90,7 @@ tvheadend.dvr_upcoming = function(panel, index) { name: 'abort', builder: function() { return new Ext.Toolbar.Button({ - tooltip: 'Abort selected recording', + tooltip: 'Abort the selected recording', iconCls: 'cancel', text: 'Abort', disabled: true, @@ -176,6 +176,30 @@ tvheadend.dvr_finished = function(panel, index) { var actions = tvheadend.dvrRowActions(); + var downloadButton = { + name: 'download', + builder: function() { + return new Ext.Toolbar.Button({ + tooltip: 'Download the selected recording', + iconCls: 'save', + text: 'Download', + disabled: true + }); + }, + callback: function(conf, e, store, select) { + var r = select.getSelections(); + if (r.length > 0) { + var url = r[0].data.url; + window.location = url; + } + } + }; + + function selected(s, abuttons) { + var count = s.getCount(); + abuttons.download.setDisabled(count < 1); + } + tvheadend.idnode_grid(panel, { url: 'api/dvr/entry', gridURL: 'api/dvr/entry/grid_finished', @@ -187,7 +211,7 @@ tvheadend.dvr_finished = function(panel, index) { del: true, list: 'disp_title,episode,start_real,stop_real,' + 'duration,filesize,channelname,creator,' + - 'sched_status', + 'sched_status,url', sort: { field: 'start', direction: 'DESC' @@ -206,6 +230,8 @@ tvheadend.dvr_finished = function(panel, index) { '?title=' + encodeURIComponent(title) + '">Play'; } }], + tbar: [downloadButton], + selected: selected, help: function() { new tvheadend.help('DVR', 'config_dvr.html'); }, diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 659ded7a..d55e4a39 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -1175,7 +1175,8 @@ tvheadend.idnode_grid = function(panel, conf) } abuttons[t.name] = b; buttons.push(b); - } + } else if (t.name) + buttons.push(t.name); } } @@ -1479,7 +1480,8 @@ tvheadend.idnode_form_grid = function(panel, conf) } abuttons[t.name] = b; buttons.push(b); - } + } else if (t.name) + buttons.push(t.name); } } diff --git a/src/webui/webui.c b/src/webui/webui.c index d9cbba37..c839a947 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -1125,7 +1125,9 @@ page_dvrfile(http_connection_t *hc, const char *remain, void *opaque) pthread_mutex_lock(&global_lock); - de = dvr_entry_find_by_id(atoi(remain)); + de = dvr_entry_find_by_uuid(remain); + if (de == NULL) + de = dvr_entry_find_by_id(atoi(remain)); if(de == NULL || de->de_filename == NULL) { pthread_mutex_unlock(&global_lock); return 404;