]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Only check minseason/maxseason/minyear/maxyear if EPG has these values, fixes...
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Sun, 27 Jan 2019 22:09:32 +0000 (22:09 +0000)
committerJaroslav Kysela <perex@perex.cz>
Mon, 4 Feb 2019 10:00:32 +0000 (11:00 +0100)
Previously if user specified a minseason=5 then we'd only record episodes that have
an appropriate season. However, Christmas specials tend to have no season or have
season=0, or might not have an episode number, so only check the autorec season if
the EPG has provided a non-zero value.

We also do the same with year.

This avoids needing to add numerous additional config item of "allow empty season",
"allow empty year", etc.

Issue: 5479

src/dvr/dvr_autorec.c

index 4a398791ee1f73ffd7489205553c35e2b3dca069..01fc1b8fcabd01ec3a1fbfe98bc26f3e16346116 100644 (file)
@@ -309,19 +309,24 @@ dvr_autorec_cmp(dvr_autorec_entry_t *dae, epg_broadcast_t *e)
     if(duration > dae->dae_maxduration) return 0;
   }
 
-  if(dae->dae_minyear > 0) {
+  /* Only do year/season checks when programme guide has these values available.
+   * This is because you might have "minseason=5" but Christmas specials have no
+   * no season (or season=0) and many people still want them to be picked up by
+   * default.
+   */
+  if(e->copyright_year && dae->dae_minyear > 0) {
     if(e->copyright_year < dae->dae_minyear) return 0;
   }
 
-  if(dae->dae_maxyear > 0) {
+  if(e->copyright_year && dae->dae_maxyear > 0) {
     if(e->copyright_year > dae->dae_maxyear) return 0;
   }
 
-  if(dae->dae_minseason > 0) {
+  if(e->epnum.s_num && dae->dae_minseason > 0) {
     if(e->epnum.s_num < dae->dae_minseason) return 0;
   }
 
-  if(dae->dae_maxseason > 0) {
+  if(e->epnum.s_num && dae->dae_maxseason > 0) {
     if(e->epnum.s_num > dae->dae_maxseason) return 0;
   }