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

Taylor Jacob rtjacob at earthlink.net
Wed Apr 6 13:31:46 UTC 2005


Quoting Stuart Auchterlonie <stuarta at squashedfrog.net>:
> The attached patch adds a few lines to siscan.cpp that delete a
> program from the program table before inserting the new program
> on the same channel at the same start time.
>
> This is for those of us who get their program guide data over
> the air from a DVB card, and it stops the logfile from filling
> up with lots of messages complaining that the program information
> couldn't be inserted because the key already exists. This is the
> normal case as the same program information is sent over and over.
>
> This mimics the same behaviour as found in programinfo.cpp

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..

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..

Taylor




More information about the mythtv-dev mailing list