]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add ability to record series from the EPG window.
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 8 Jun 2012 14:45:31 +0000 (15:45 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 8 Jun 2012 14:45:31 +0000 (15:45 +0100)
src/webui/extjs.c
src/webui/static/app/epg.js

index a795f9558655d7fbbba86ec99dbece02997c70bb..056ad043c3c72805dcd40d8f946d9945cb805abf 100644 (file)
@@ -881,7 +881,7 @@ extjs_dvr(http_connection_t *hc, const char *remain, void *opaque)
     return HTTP_STATUS_UNAUTHORIZED;
   }
 
-  if(!strcmp(op, "recordEvent")) {
+  if(!strcmp(op, "recordEvent") || !strcmp(op, "recordSeries")) {
 
     const char *config_name = http_arg_get(&hc->hc_req_args, "config_name");
 
@@ -904,8 +904,11 @@ extjs_dvr(http_connection_t *hc, const char *remain, void *opaque)
         tvhlog(LOG_INFO,"dvr","User '%s' has no dvr config with identical name, using default...", hc->hc_username);
     }
 
-    dvr_entry_create_by_event(config_name,
-                              e, hc->hc_representative, NULL, DVR_PRIO_NORMAL);
+    if (!strcmp(op, "recordEvent"))
+      dvr_entry_create_by_event(config_name,
+                                e, hc->hc_representative, NULL, DVR_PRIO_NORMAL);
+    else
+      dvr_autorec_add_series_link(config_name, e, hc->hc_representative, "Created from EPG query");
 
     out = htsmsg_create_map();
     htsmsg_add_u32(out, "success", 1);
index be30ccf6332ff510187d995e93539e8fbf41f1d4..6182d01daa0f7eff72cc7eb7e0e5093513159b88 100644 (file)
@@ -70,7 +70,7 @@ tvheadend.epgDetails = function(event) {
        title: event.title,
        bodyStyle: 'margin: 5px',
         layout: 'fit',
-        width: 400,
+        width: 500,
         height: 300,
        constrainHeader: true,
        buttons: [
@@ -78,20 +78,31 @@ tvheadend.epgDetails = function(event) {
            new Ext.Button({
                handler: recordEvent,
                text: "Record program"
-           })
+           }),
+    new Ext.Button({
+      handler: recordSeries,
+      text: "Record series"
+    })
        ],
        buttonAlign: 'center',
        html: content
     });
     win.show();
 
-
     function recordEvent() {
+      record('recordEvent');
+    }
+
+    function recordSeries() {
+      record('recordSeries');
+    }
+
+    function record(op) {
        Ext.Ajax.request({
            url: 'dvr',
            params: {
                 eventId: event.id, 
-                op: 'recordEvent', 
+                op: op,
                 config_name: confcombo.getValue()
             },