]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
WEBUI JS: Add back the download button for finished recordings
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 Sep 2014 15:04:25 +0000 (17:04 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 8 Sep 2014 14:48:59 +0000 (16:48 +0200)
src/webui/static/app/dvr.js
src/webui/static/app/idnode.js
src/webui/webui.c

index 0e45efe1a155b2a5ffc3d0ce57dd0e6f53839cb2..4debd5573f4dec841752c0af896fadd039d50b34 100644 (file)
@@ -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</a>';
                 }
             }],
+        tbar: [downloadButton],
+        selected: selected,
         help: function() {
             new tvheadend.help('DVR', 'config_dvr.html');
         },
index 659ded7afddfb4ffdb34773dfe4527905bb4ed80..d55e4a3907e5514be87437fe10fd8f25d65dba25 100644 (file)
@@ -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);
             }
         }
 
index d9cbba3789ca7512ec5080a4042b68e9035f15c0..c839a947eee5cf23456f1ea85d1f207c2ab91c70 100644 (file)
@@ -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;