[mythtv] [PATCH] Control duplicates by channel ID

David Engel david at istwok.net
Sun Aug 5 17:01:35 UTC 2007


On Sun, Aug 05, 2007 at 07:42:42AM -0500, David Shay wrote:
> Determined what at least one of the problems here is.  The primary key
> to oldrecorded does not include chanid. This makes the "REPLACE"
> statement in AddHistory not add a new record when it now should.  I'm
> not sure if there would be any other impacts of just adding chanid
> into the key for oldrecorded.

Oh, shoot.  Yes, oldrecorded imposes the restriction of one entry per
title, starttime and callsign.  The scheduler relies on this when
restoring any previous status for programs that aren't currently
recording and for catching reactivation requests.  I'd be very
concerned about the impact of allowing additional entries per chanid
on this functionality.

> I'm pretty sure there are some other cases where things could go wrong
> as well in the calls to AddHistory, particularly where
> IsSameProgramTimeslot is called on a pointer to a PI structure.  There
> the checks don't take chanid into account.  In my current code I've

I think IsSameProgramTimeslot is a hold over from long ago when the
program start and times weren't kept around and only the recording
times available.  The IsSameProgramTimeslot check was made fuzzy to
allow for differences in the recording times that could creep in
between the scheduler and the recorders.  It looks like
Scheduler::UpdateRecStatus is the only remaining user of
IsSameProgramTimeslot and it can probably be replaced with
IsSameProgram now.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-dev mailing list