]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
EPG: show also separate "Season XXX" info in EPG and DVR
authorpablozg <pablozg@gmail.com>
Sun, 25 Feb 2018 11:39:57 +0000 (12:39 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 25 Feb 2018 17:57:26 +0000 (18:57 +0100)
src/dvr/dvr_db.c
src/epg.c

index c3e41550926a0a2f5d0b706e970dbd2565166fb4..39eb9ccde908c2542bef9526a0f38b99c4c147b0 100644 (file)
@@ -3286,7 +3286,7 @@ dvr_entry_class_disp_episode_get(void *o)
   dvr_entry_t *de = (dvr_entry_t *)o;
   const char *lang;
   char buf1[32], buf2[32];
-  if (de->de_epnum.e_num) {
+  if (de->de_epnum.e_num || de->de_epnum.s_num) {
     lang = idnode_lang(o);
     snprintf(buf1, sizeof(buf1), "%s %%d", tvh_gettext_lang(lang, N_("Season")));
     snprintf(buf2, sizeof(buf2), "%s %%d", tvh_gettext_lang(lang, N_("Episode")));
index e64a9d1e147256471730bca22818ba70f76d7b88..0f9ad14eb1338dc0ebeb2184a8f4fc562d2ca879 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -412,15 +412,16 @@ size_t epg_episode_num_format
   size_t i = 0;
   if (!epnum || !buf || !len) return 0;
   buf[0] = '\0';
-  if (epnum->e_num) {
+  if (epnum->e_num || epnum->s_num) {
     if (pre) tvh_strlcatf(buf, len, i, "%s", pre);
     if (sfmt && epnum->s_num) {
       tvh_strlcatf(buf, len, i, sfmt, epnum->s_num);
       if (cfmt && epnum->s_cnt)
         tvh_strlcatf(buf, len, i, cfmt, epnum->s_cnt);
-      if (sep) tvh_strlcatf(buf, len, i, "%s", sep);
+      if (sep && efmt && epnum->e_num) tvh_strlcatf(buf, len, i, "%s", sep);
     }
-    tvh_strlcatf(buf, len, i, efmt, epnum->e_num);
+    if (efmt && epnum->e_num)
+      tvh_strlcatf(buf, len, i, efmt, epnum->e_num);
     if (cfmt && epnum->e_cnt)
       tvh_strlcatf(buf, len, i, cfmt, epnum->e_cnt);
   } else if (epnum->text) {