From: pablozg Date: Sun, 25 Feb 2018 11:39:57 +0000 (+0100) Subject: EPG: show also separate "Season XXX" info in EPG and DVR X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e122836bf0119ec3519cbb120243157882e2dd0;p=thirdparty%2Ftvheadend.git EPG: show also separate "Season XXX" info in EPG and DVR --- diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c index c3e415509..39eb9ccde 100644 --- a/src/dvr/dvr_db.c +++ b/src/dvr/dvr_db.c @@ -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"))); diff --git a/src/epg.c b/src/epg.c index e64a9d1e1..0f9ad14eb 100644 --- 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) {