From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Sun, 27 Jan 2019 22:09:32 +0000 (+0000) Subject: dvr: Only check minseason/maxseason/minyear/maxyear if EPG has these values, fixes... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=145082b658816ff916982c36abed42b6d298ae16;p=thirdparty%2Ftvheadend.git dvr: Only check minseason/maxseason/minyear/maxyear if EPG has these values, fixes #5479 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 --- diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index 4a398791e..01fc1b8fc 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -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; }