diff --git a/src/webui/static/app/dvr.js b/src/webui/static/app/dvr.js
index 2f5a5a58..701594fe 100644
--- a/src/webui/static/app/dvr.js
+++ b/src/webui/static/app/dvr.js
@@ -88,13 +88,6 @@ tvheadend.dvrDetails = function(entry) {
content += '
';
content += 'Status: ' + entry.status + '
';
- if (entry.url != null && entry.filesize > 0) {
- content += '';
-
- }
-
var win = new Ext.Window({
title: entry.title,
layout: 'fit',
@@ -473,6 +466,13 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
});
}
};
+
+ function downloadSelected() {
+ var selectedKey = panel.selModel.selections.keys[0];
+ var entry = dvrStore.getById(selectedKey);
+
+ window.location = entry.data.url;
+ }
function abortSelected() {
Ext.MessageBox.confirm('Message',
@@ -491,6 +491,14 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
handler: abortSelected,
disabled: true
});
+
+ var downloadButton = new Ext.Toolbar.Button({
+ tooltip: 'Download the selected recording',
+ iconCls: 'save',
+ text: 'Download',
+ handler: downloadSelected,
+ disabled: true
+ });
var deleteButton = new Ext.Toolbar.Button({
tooltip: 'Delete one or more selected rows',
@@ -510,8 +518,15 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
if (self.getCount() > 0) {
deleteButton.enable();
abortButton.enable();
+
+ // It only makes sense to download one item at a time
+ if (self.getCount() === 1)
+ downloadButton.enable();
+ else
+ downloadButton.disable();
}
else {
+ downloadButton.disable();
deleteButton.disable();
abortButton.disable();
}
@@ -532,8 +547,9 @@ tvheadend.dvrschedule = function(title, iconCls, dvrStore) {
abortButton
]);
}
- // Add the "Delete recordings" button to the others
+ // Add the "Download" and "Delete" button to the others
else {
+ panelButtons.push(downloadButton);
panelButtons.push(deleteButton);
}