[mythtv-users] Premieres rule

Justin Johnson justin.johnson3 at gmail.com
Tue Jul 13 19:20:56 UTC 2010


On Tue, Jul 13, 2010 at 9:28 AM, Mike Holden <mythtv at mikeholden.org> wrote:
> Brian J. Murrell wrote:
>> As can be seen, it aired after it's originalairdate.  :-(
>>
>> Since I do this search daily and I keep a history of the searches, I
>> searched through all of June to see if this was ever matching and it
>> never did, so I can only assume that for whatever reason, the actual
>> air
>> date of the premiere episode(s) was delayed from it's original air
>> date.
>>
>> I tried removing the
>>
>> program.originalairdate = DATE(program.starttime)
>>
>> condition but way too many false positives came up.
>>
>> Any ideas?
>
> Could you check that the original air date is within a defined
> period (say 1 month) of the start time of the program? This would
> remove most of the false positives (probably). You could look at
> using the "DATEDIFF()" function in mysql for this, possibly also
> incorporating "ABS()" to ignore the sign of the number returned.
>
> Something like:
>    ABS(DATEDIFF(program.originalairdate,DATE(program.starttime)) <= 31
> --
> Mike Holden

Wow, I just faced this same issue about a month ago, I noticed that I
suddenly had a large number of conflicts and determined that it was
because the myth scheduler was only looking for premieres on the exact
day, but oftentimes a show is repeated several times throughout the
week. So I looked into it and came up with this rule:

program.programid LIKE 'EP%0001'
AND ABS(DATEDIFF(DATE(program.starttime),program.originalairdate)) < 7
AND program.category NOT LIKE 'Shopping'
AND program.category NOT LIKE '%Sports%'

I excluded shopping and sports shows as I didn't want to record any of
those. You can simply adjust the number to meet your needs, though I
have found that 7 works quite well (it also means that myth won't wait
until the encore showing one week later, just before episode number
2). This rule isn't perfect, particularly, the programid LIKE
'EP%0001' doesn't always correspond to episode number 1, I've gotten a
couple that correspond to episode number 2. Not a huge problem since I
don't watch many of the programs that are recorded by this rule, but
still noteworthy. It really depends on the quality of your guide data
but for the most part works quite well.

--Justin Johnson


More information about the mythtv-users mailing list