Project

General

Profile

Feature #4500

Use the autorec rule name in the Upcoming tab if the comment field is empty [mini-patch]

Added by Em Smith over 4 years ago. Updated over 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-07-25
Due date:
% Done:

100%

Estimated time:

Description

Currently the Upcoming recordings tab has a comment field that says "Auto recording" or "Auto recording: <comment from autorec rule>". This helps to identify why a recording is scheduled.

I never knew the second format existed until I looked at the code.

Since my comment field would almost always be the same as my rule name, I submit a mini-patch to use the autorec comment field if it is non-empty (keeping existing behaviour), but fallback to the recording rule name. If both are empty then it keep the existing behaviour of fallback to an empty string.

So, in the above case it would be "Auto recording: <comment>", "Auto recording: <rule name>", otherwise "Auto recording".

The name change only occurs after a schedule is triggered, so you will only see a difference with new recordings or if you modify an autorec rule.

diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c
index 828ca1a4a..9a6a6fbd5 100644
--- a/src/dvr/dvr_db.c
+++ b/src/dvr/dvr_db.c
@@ -1463,9 +1463,11 @@ dvr_entry_create_by_autorec(int enabled, epg_broadcast_t *e, dvr_autorec_entry_t
     }
   }

+  /* Prefer the recording comment or the name of the rule to an empty string */
+  const char *comment_suffix = dae->dae_comment ?: dae->dae_name ?: "";
   snprintf(buf, sizeof(buf), _("Auto recording%s%s"),
-           dae->dae_comment ? ": " : "",
-           dae->dae_comment ?: "");
+           comment_suffix ? ": " : "",
+           comment_suffix ?: "");

   dvr_entry_create_by_event(enabled, idnode_uuid_as_str(&dae->dae_config->dvr_id, ubuf),
                             e, dae->dae_start_extra, dae->dae_stop_extra,

Associated revisions

Revision efbbb7f8 (diff)
Added by Em Smith over 4 years ago

DVR: Prefer autorec rule name if comment field is empty (#4500)

Currently the Upcoming recordings tab has a comment field that says
"Auto recording" or "Auto recording: <comment from autorec rule>".
This helps to identify why a recording is scheduled.

This patch ensures we continue to use the autorec comment field if
it is non-empty (keeping existing behaviour), but fallback to using
the recording rule name. If both are empty then we keep the
existing behaviour of fallback to an empty string.

This avoids the user having to duplicate the rule name in to
the comment string for manually created autorec rules.

So, in the above case it would be "Auto recording: <comment>",
"Auto recording: <rule name>", otherwise "Auto recording".

Fixes: #4500.

Revision ffb578c4 (diff)
Added by Em Smith over 4 years ago

DVR: Prefer autorec rule name if comment field is empty (#4500)

Currently the Upcoming recordings tab has a comment field that says
"Auto recording" or "Auto recording: <comment from autorec rule>".
This helps to identify why a recording is scheduled.

This patch ensures we continue to use the autorec comment field if
it is non-empty (keeping existing behaviour), but fallback to using
the recording rule name. If both are empty then we keep the
existing behaviour of fallback to an empty string.

This avoids the user having to duplicate the rule name in to
the comment string for manually created autorec rules.

So, in the above case it would be "Auto recording: <comment>",
"Auto recording: <rule name>", otherwise "Auto recording".

Fixes: #4500.

History

#1

Updated by Joe User over 4 years ago

I took another approach, but maybe yours is better???
[[http://tvheadend.org/issues/4052]]

#2

Updated by Em Smith over 4 years ago

All of my autorecs are manually created to be quite generic ("record any movie that has these actors"), rather than autorecs based on EPG.

For your issue, the GUI is generating a generic comment string and no rule name so this patch doesn't help. I think this patch should respect the comment field since it could be entered by the user.

However, I submitted a patch in your bug to include the title in future autorec comments which should help your issue.

#3

Updated by Em Smith over 4 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF