WEBUI JS: Add back the download button for finished recordings
This commit is contained in:
parent
7c4ff817b3
commit
3faeb82e88
3 changed files with 35 additions and 5 deletions
|
@ -90,7 +90,7 @@ tvheadend.dvr_upcoming = function(panel, index) {
|
||||||
name: 'abort',
|
name: 'abort',
|
||||||
builder: function() {
|
builder: function() {
|
||||||
return new Ext.Toolbar.Button({
|
return new Ext.Toolbar.Button({
|
||||||
tooltip: 'Abort selected recording',
|
tooltip: 'Abort the selected recording',
|
||||||
iconCls: 'cancel',
|
iconCls: 'cancel',
|
||||||
text: 'Abort',
|
text: 'Abort',
|
||||||
disabled: true,
|
disabled: true,
|
||||||
|
@ -176,6 +176,30 @@ tvheadend.dvr_finished = function(panel, index) {
|
||||||
|
|
||||||
var actions = tvheadend.dvrRowActions();
|
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, {
|
tvheadend.idnode_grid(panel, {
|
||||||
url: 'api/dvr/entry',
|
url: 'api/dvr/entry',
|
||||||
gridURL: 'api/dvr/entry/grid_finished',
|
gridURL: 'api/dvr/entry/grid_finished',
|
||||||
|
@ -187,7 +211,7 @@ tvheadend.dvr_finished = function(panel, index) {
|
||||||
del: true,
|
del: true,
|
||||||
list: 'disp_title,episode,start_real,stop_real,' +
|
list: 'disp_title,episode,start_real,stop_real,' +
|
||||||
'duration,filesize,channelname,creator,' +
|
'duration,filesize,channelname,creator,' +
|
||||||
'sched_status',
|
'sched_status,url',
|
||||||
sort: {
|
sort: {
|
||||||
field: 'start',
|
field: 'start',
|
||||||
direction: 'DESC'
|
direction: 'DESC'
|
||||||
|
@ -206,6 +230,8 @@ tvheadend.dvr_finished = function(panel, index) {
|
||||||
'?title=' + encodeURIComponent(title) + '">Play</a>';
|
'?title=' + encodeURIComponent(title) + '">Play</a>';
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
tbar: [downloadButton],
|
||||||
|
selected: selected,
|
||||||
help: function() {
|
help: function() {
|
||||||
new tvheadend.help('DVR', 'config_dvr.html');
|
new tvheadend.help('DVR', 'config_dvr.html');
|
||||||
},
|
},
|
||||||
|
|
|
@ -1175,7 +1175,8 @@ tvheadend.idnode_grid = function(panel, conf)
|
||||||
}
|
}
|
||||||
abuttons[t.name] = b;
|
abuttons[t.name] = b;
|
||||||
buttons.push(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;
|
abuttons[t.name] = b;
|
||||||
buttons.push(b);
|
buttons.push(b);
|
||||||
}
|
} else if (t.name)
|
||||||
|
buttons.push(t.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1125,7 +1125,9 @@ page_dvrfile(http_connection_t *hc, const char *remain, void *opaque)
|
||||||
|
|
||||||
pthread_mutex_lock(&global_lock);
|
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) {
|
if(de == NULL || de->de_filename == NULL) {
|
||||||
pthread_mutex_unlock(&global_lock);
|
pthread_mutex_unlock(&global_lock);
|
||||||
return 404;
|
return 404;
|
||||||
|
|
Loading…
Add table
Reference in a new issue