[mythtv] Patch for mythfilldatabase --no-delete
Andrew M. Bishop
amb at gedanken.demon.co.uk
Wed Mar 2 18:52:35 UTC 2005
Oscar Carlsson <webmaster at trekotor.se> writes:
> Andrew M. Bishop wrote, On 2005-02-28 20:24:
> > I am the original author of the --no-delete option to mythfilldatabase
> > nearly two years ago, as I told Isaac at the time that I sent the
> > patch:
>
> > : I have added a new option to mythfilldatabase, called '--no-delete'.
> > : This option does two things:
> > : 1) when it gets new data from XMLTV it won't delete the existing data
> > : day-by-day but program-by-program. This means that if a single
> > : program changes between grabs of data by XMLTV it will only update
> > : that one.
> > : 2) it only deletes programs from the database when they are more than
> > : a week old.
> Ok. Why don't we just make this behavior (the first one) the default (as
> it is now really), and make the --no-delete only do the second part? At
> least that's the way I expected it to work.
I am not opposed to only deleting programs that are changed rather
than deleting the whole day. That is the reason that I added the
option in the first place. I don't know if there are any opposing
opinions that say that the whole day should be deleted.
I also don't see why people are so keen to wipe out history. Has
nobody else ever wanted to go back to yesterday's programs and select
one for a future recording. I think that the default should be to
keep the last 7 days of history.
You have my vote in making --no-delete the default for both parts.
> No idea to remove the whole day if there is logic for smarter removal
> before inserting, don't you think?
That is why I made the change.
> But, anyway, if you look at the changes I made you can see (as far as I
> can remember) that the whole day _was_ indeed cleared in either case
> before entering that if-clause.
I can tell you from experience that the whole day is not cleared. If
it was then I would not have had any SQL errors when performing the
insert. If the whole day is cleared then there is no need to check if
a program already exists in the database, obviously it wouldn't.
When I run mythfilldatabase --no-delete from version 0.17 I got
several thousand SQL insert errors due to duplicate data. With my
one-line patch to reverse the 'if' statement there were no errors.
There can only be insert errors due to duplicate data if the whole day
was not cleared.
--
Andrew.
----------------------------------------------------------------------
Andrew M. Bishop amb at gedanken.demon.co.uk
http://www.gedanken.demon.co.uk/
More information about the mythtv-dev
mailing list