]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[WebUI] Option to hide seconds in DVR Dialogue. master
authorDeltaMikeCharlie <127641886+DeltaMikeCharlie@users.noreply.github.com>
Sun, 26 Apr 2026 01:39:26 +0000 (11:39 +1000)
committerFlole <Flole998@users.noreply.github.com>
Sun, 26 Apr 2026 11:43:05 +0000 (13:43 +0200)
src/config.c
src/config.h
src/webui/comet.c
src/webui/static/app/idnode.js
src/webui/static/app/tvheadend.js

index 1c4098e0ae561a4d0f10ad6e856d03583a0202ad..45cba706bc396845522bc01befdf3b6b49ee41f6 100644 (file)
@@ -1779,6 +1779,7 @@ config_boot
   config.iptv_tpool_count = 2;
   config.date_mask = strdup("");
   config.label_formatting = 0;
+  config.dvr_show_seconds = 1;
   config.hdhomerun_ip = strdup("");
   config.local_ip = strdup("");
   config.local_port = 0;
@@ -2396,6 +2397,17 @@ const idclass_t config_class = {
       .opts   = PO_DOC_NLIST,
       .group  = 2
     },
+    {
+      .type   = PT_BOOL,
+      .id     = "dvr_show_seconds",
+      .name   = N_("Show DVR seconds"),
+      .desc   = N_("Show seconds in the DVR entry add/edit dialogue window. "
+                   "If disabled, existing seconds can not be edited and "
+                   "new entries will have seconds set to zero."),
+      .opts   = PO_ADVANCED,
+      .off    = offsetof(config_t, dvr_show_seconds),
+      .group  = 2,
+    },
     {
       .type   = PT_BOOL,
       .id     = "label_formatting",
index 0cab40962037a63419e7428d46804e20f0738e05..d480008cd193fc815d3b73e9b10b63c69527ac2b 100644 (file)
@@ -72,6 +72,7 @@ typedef struct config {
   int iptv_tpool_count;
   char *date_mask;
   int label_formatting;
+  int dvr_show_seconds;
   uint32_t ticket_expires;
   char *hdhomerun_ip;
   char *local_ip;
index 2554170de2facdea56963110e71243ce59cf8e83..b115fefdb9bd1e2a5ff502eed4d7c48ab4dc0542 100644 (file)
@@ -193,9 +193,8 @@ comet_access_update(http_connection_t *hc, comet_mailbox_t *cmb)
   htsmsg_add_u32(m, "chname_src", config.chname_src);
   htsmsg_add_str(m, "date_mask", config.date_mask);
   htsmsg_add_u32(m, "label_formatting", config.label_formatting);
-  
   htsmsg_add_u32(m, "default_tab", default_tab);
-  
+  htsmsg_add_u32(m, "dvr_show_seconds", config.dvr_show_seconds);
   if (!access_noacl)
     htsmsg_add_str(m, "username", username);
   if (hc->hc_peer_ipstr)
index 07b2e17c47aaf2167794e64af3f59a69ddcd11b6..cb9a78e58cd5bd71d8512c4a924e5915e490fc2b 100644 (file)
@@ -786,9 +786,9 @@ tvheadend.idnode_editor_field = function(f, conf)
                     value: value,
                     disabled: false,
                     width: 300,
-                    timeFormat: 'H:i:s',
+                    timeFormat: tvheadend.dvr_show_seconds ? 'H:i:s' : 'H:i',
                     timeConfig: {
-                        altFormats: 'H:i:s',
+                        altFormats: 'H:i:s|H:i',
                         allowBlank: true,
                         increment: 10
                     },
index e135ea8ca329faf18db878171f784f18bdb3a260..48308a2f897ffcea25ed4120f6205f4126564c86 100644 (file)
@@ -41,6 +41,7 @@ tvheadend.docs_toc = null;
 tvheadend.doc_history = [];
 tvheadend.doc_win = null;
 tvheadend.date_mask = '';
+tvheadend.dvr_show_seconds = true;
 tvheadend.label_formatting = false;
 tvheadend.language = window.navigator.userLanguage || window.navigator.language;
 tvheadend.default_tab = CONFIG_DEFAULT_TAB_EPG;
@@ -1057,6 +1058,7 @@ function accessUpdate(o) {
     tvheadend.chname_num = o.chname_num ? 1 : 0;
     tvheadend.chname_src = o.chname_src ? 1 : 0;
     tvheadend.date_mask = o.date_mask;
+    tvheadend.dvr_show_seconds = o.dvr_show_seconds ? true : false;
     tvheadend.label_formatting = o.label_formatting ? true : false;
     tvheadend.page_size = o.page_size;
     tvheadend.default_tab = o.default_tab ? o.default_tab : CONFIG_DEFAULT_TAB_EPG;