From a46a8c967382ed27735cb2bc1968a56a1d513509 Mon Sep 17 00:00:00 2001 From: joeuser Date: Mon, 3 Dec 2018 08:05:02 +0100 Subject: [PATCH] Prepend title to autorec comment when created from EPG. --- src/api/api_dvr.c | 9 +++++++-- src/webui/static/app/epg.js | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/api/api_dvr.c b/src/api/api_dvr.c index 134cab15b..68829e277 100644 --- a/src/api/api_dvr.c +++ b/src/api/api_dvr.c @@ -462,9 +462,11 @@ api_dvr_autorec_create_by_series epg_broadcast_t *e; htsmsg_t *entries, *entries2 = NULL, *m, *l = NULL; htsmsg_field_t *f; - const char *config_uuid, *s; + const char *config_uuid, *s, *title; int count = 0; char ubuf[UUID_HEX_SIZE]; + const char * msg = " - Created from EPG query"; + char *comment; if (!(entries = htsmsg_get_list(args, "entries"))) { entries = entries2 = api_dvr_entry_create_from_single(args); @@ -484,11 +486,14 @@ api_dvr_autorec_create_by_series if ((e = epg_broadcast_find_by_id(strtoll(s, NULL, 10)))) { dvr_config_t *cfg = dvr_config_find_by_list(perm->aa_dvrcfgs, config_uuid); if (cfg) { + title = epg_broadcast_get_title(e, NULL); + comment = alloca(strlen(title) + strlen(msg) + 1); + sprintf(comment, "%s%s", title, msg); dae = dvr_autorec_add_series_link(idnode_uuid_as_str(&cfg->dvr_id, ubuf), e, perm->aa_username, perm->aa_representative, - "Created from EPG query"); + comment); if (dae) { if (l == NULL) l = htsmsg_create_list(); diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js index d7140bec1..ffb5c1eaf 100644 --- a/src/webui/static/app/epg.js +++ b/src/webui/static/app/epg.js @@ -1503,7 +1503,12 @@ tvheadend.epg = function() { enabled: 1, comment: _('Created from EPG query') }; - if (params.title) conf.title = params.title; + if (params.title) { + conf.title = params.title; + // Amend comment to include the title to make it easier for + // user to match upcoming/finished recordings to autorecs. + conf.comment = conf.title + _(' - ') + conf.comment; + } if (params.fulltext) conf.fulltext = params.fulltext; if (params.new) conf.btype = 3; // DVR_AUTOREC_BTYPE_NEW in dvr.h has value 3. if (params.channel) conf.channel = params.channel; -- 2.47.2