]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Prepend title to autorec comment when created from EPG.
authorjoeuser <joeusercz@goglemail.co>
Mon, 3 Dec 2018 07:05:02 +0000 (08:05 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 5 Dec 2018 16:47:00 +0000 (17:47 +0100)
src/api/api_dvr.c
src/webui/static/app/epg.js

index 134cab15b88a35dbd134cc107652a9bc3561a79b..68829e277107e8ca650c1d56bf4afdfc93188f24 100644 (file)
@@ -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();
index d7140bec150832989b510ba2eb94f8814fdd6d89..ffb5c1eafae947b5c5a9bd66094cef7779d5586d 100644 (file)
@@ -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;