Project

General

Profile

Actions

Feature #4934

closed

SAT>IP: Print list of PIDs used in the SUBSCRIPTION section of the UI

Added by Mono Polimorph about 7 years ago. Updated over 6 years ago.

Status:
Fixed
Priority:
Normal
Category:
SAT>IP
Target version:
-
Start date:
2018-02-12
Due date:
% Done:

0%

Estimated time:

Description

Hi Jaroslav,

Another interesting patch for improving the UI.
For a lot of time I need to know the pid list used by users (for SAT>IP debug). And in several environments the use of the Debug output it's a pain. So I prepared a new improvement for the UI.

This patch, adds the option for printing in the Subscription section the list of pids.

diff --git a/src/subscriptions.c b/src/subscriptions.c
index 0b30b2a..afea446 100644
--- a/src/subscriptions.c
+++ b/src/subscriptions.c
@@ -1015,6 +1015,7 @@ subscription_create_msg(th_subscription_t *s, const char *lang)
   profile_t *pro;
   char buf[284];
   const char *state;
+  htsmsg_t *l;

   htsmsg_add_u32(m, "id", s->ths_id);
   htsmsg_add_u32(m, "start", s->ths_start);
@@ -1080,6 +1081,23 @@ subscription_create_msg(th_subscription_t *s, const char *lang)
   } else if(s->ths_dvrfile != NULL)
     htsmsg_add_str(m, "service", s->ths_dvrfile ?: "");

+#if ENABLE_MPEGTS
+  mpegts_service_t *ms = (mpegts_service_t *)s->ths_service;
+  mpegts_apids_t *pids;
+  if ((pids = ms->s_pids) != NULL) {
+    l = htsmsg_create_list();
+    if (pids->all) {
+      htsmsg_add_s32(l, NULL, 8192);
+    } else {
+      int i;
+      for (i = 0; i < pids->count; i++) {
+        htsmsg_add_s32(l, NULL, pids->pids[i].pid);
+      }
+    }
+    htsmsg_add_msg(m, "pids", l);
+  }
+#endif
+
   htsmsg_add_u32(m, "in", atomic_get(&s->ths_bytes_in_avg));
   htsmsg_add_u32(m, "out", atomic_get(&s->ths_bytes_out_avg));
   htsmsg_add_s64(m, "total_in", atomic_get_u64(&s->ths_total_bytes_in));
diff --git a/src/webui/static/app/status.js b/src/webui/static/app/status.js
index 0ac4b78..988934e 100644
--- a/src/webui/static/app/status.js
+++ b/src/webui/static/app/status.js
@@ -20,6 +20,7 @@ tvheadend.status_subs = function(panel, index)
             r.data.channel = m.channel;
             r.data.service = m.service;
             r.data.state = m.state;
+            if (m.pids) r.data.pids = m.pids;
             if (m.descramble) r.data.descramble = m.descramble;
             if (m.profile) r.data.profile = m.profile;
             r.data.errors = m.errors;
@@ -49,6 +50,7 @@ tvheadend.status_subs = function(panel, index)
                 { name: 'service', sortType: stype },
                 { name: 'profile', sortType: stype },
                 { name: 'state', sortType: stype },
+                { name: 'pids' },
                 { name: 'descramble', sortType: stype },
                 { name: 'errors', sortType: stype },
                 { name: 'in', sortType: stype },
@@ -115,7 +117,7 @@ tvheadend.status_subs = function(panel, index)
                 sortable: true
             },
             {
-                width: 250,
+                width: 210,
                 id: 'service',
                 header: _("Service"),
                 dataIndex: 'service',
@@ -147,6 +149,22 @@ tvheadend.status_subs = function(panel, index)
                 sortable: true
             },
             {
+                width: 90,
+                id: 'pids',
+                header: _("PID list"),
+                dataIndex: 'pids',
+                sortable: false,
+                renderer: function(v) {
+                    var r = [];
+                    Ext.each(v, function(pid) {
+                      r.push(pid);
+                    });
+                    if (r.length < 1) return "";
+                    r.sort(function(a, b){return a-b});
+                    return r.join(',');
+                }
+            },
+            {
                 width: 80,
                 id: 'descramble',
                 header: _("Descramble"),

I hope you agree and commit this patch! ;)
Regards!


Files

SAT-IP-Subscription-shows-current-PIDS.diff (3.28 KB) SAT-IP-Subscription-shows-current-PIDS.diff simple patch Mono Polimorph, 2018-02-12 20:47
Actions

Also available in: Atom PDF