From 0a7803676affb205b30fb7a8eb66733226415e5c Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 8 Jun 2012 15:45:31 +0100 Subject: [PATCH] Add ability to record series from the EPG window. --- src/webui/extjs.c | 9 ++++++--- src/webui/static/app/epg.js | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/webui/extjs.c b/src/webui/extjs.c index a795f955..056ad043 100644 --- a/src/webui/extjs.c +++ b/src/webui/extjs.c @@ -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); diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index be30ccf6..6182d01d 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -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() },