[mythtv] [PATCH] Stop complaints about duplicate keys on program insert

Stuart Auchterlonie stuarta at squashedfrog.net
Wed Apr 6 14:11:05 UTC 2005


On Wed, Apr 06, 2005 at 09:31:46AM -0400, Taylor Jacob wrote:
> 
> I can apply this, but if you are already in siscan.cpp I would suggest the
> following that I haven't been able to get the time to look into if you are so
> inclined.
> 
> You really need to check if there are events within the bounds of the new
> program thats being inserted instead of an exact match.. Also since I don't
> believe mysql can wrap transactions there probbably should be some checks to
> see if the event thats present in the table needs to be purged at all so you
> don't temporarily remove the event and re-add it.. I wound't want to be
> browsing the EPG and have shows drop out and show back up.. (Probbably doping a
> check on name, event time, and description would suffice)..  I have seen this
> with changing EIT and differeing times that you will get two entries that are
> within the same time block (Example Program A was scheudled from 1000-1100 and
> then there is a new program from 1010-1100 instead.. You will get 2 entries in
> the DB which looks pretty crazy on the EPG not to mention I don't know what it
> really does to the scheduler..

I'm sure I saw this the other week with a movie being moved back a half
hours. This fix was only a start to shut the backend up. So there isn't
much point applying it permanently. As someone else pointed out it's 
probably simpler just to change the INSERT to REPLACE, though neither
of us know if that requires a specific version of mysql.

I'm going to sit down and see what I can come up with in the way of a
proper fix 

> 
> Thanks for fixing this I've been rather busy with real-life things for the last
> few weeks and haven't been able to get much new stuff done with Myth..

Not a problem. Hopefully I'll have something better soon...

Stuart



More information about the mythtv-dev mailing list