Project

General

Profile

Actions

Feature #5025

open

Propose an enhancement to #5009 fix

Added by Steve P about 7 years ago. Updated about 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-03-24
Due date:
% Done:

0%

Estimated time:

Description

Hi,

Very useful addition for me in fix for #5009:

https://tvheadend.org/projects/tvheadend/repository/revisions/222c8541b981e6db6fa9f2d59f2553235bbc1c4b

But the format is very unreadable in my circumstances, can I propose the following change to format thus:

Channel Name (num) - See attached image

diff --git a/src/channels.c b/src/channels.c
index 9cf5ad4..e2d3bea 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -833,26 +833,27 @@ channel_get_ename
   const char *s;

   dst[0] = '\0';
+  s = channel_get_name(ch, blank);
+  if (s)
+    tvh_strlcatf(dst, dstlen, l, "%s", s);
+  if (flags & CHANNEL_ENAME_SOURCES) {
+    s = channel_get_source(ch, buf, sizeof(buf));
+    if (s)
+      tvh_strlcatf(dst, dstlen, l, "[%s]", s);
+  }
   if (flags & CHANNEL_ENAME_NUMBERS) {
     number = channel_get_number(ch);
     if (number > 0) {
       if (number % CHANNEL_SPLIT) {
-        tvh_strlcatf(dst, dstlen, l, "%u.%u",
+        tvh_strlcatf(dst, dstlen, l, "%s(%u.%u)",
+                     l > 0 ? " " : "",
                      channel_get_major(number),
                      channel_get_minor(number));
       } else {
-        tvh_strlcatf(dst, dstlen, l, "%u", channel_get_major(number));
+        tvh_strlcatf(dst, dstlen, l, "%s(%u)", l > 0 ? " " : "", channel_get_major(number));
       }
     }
   }
-  s = channel_get_name(ch, blank);
-  if (s)
-    tvh_strlcatf(dst, dstlen, l, "%s%s", l > 0 ? " " : "", s);
-  if (flags & CHANNEL_ENAME_SOURCES) {
-    s = channel_get_source(ch, buf, sizeof(buf));
-    if (s)
-      tvh_strlcatf(dst, dstlen, l, "%s[%s]", l > 0 ? " " : "", s);
-  }
   return dst;
 }

Files

DVRChannelNUM.png (72.7 KB) DVRChannelNUM.png Steve P, 2018-03-24 11:11
Actions

Also available in: Atom PDF