<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Michael T. Dean wrote:
<blockquote cite="mid:46FB6E1A.6010500@thirdcontact.com" type="cite">
<pre wrap="">On 09/26/2007 08:06 PM, Darren wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Thursday 27 September 2007 04:01, Jon Larson wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I use mythfilldatabase --file to import program data from an XML file.
Not being a database expert, I assumed that mythfilldatabase basically
compares the mythtv listings to the XML file and does the following:
Programs that are missing in MythTV would be added, programs with
changed attributes would be updated, and programs that are missing in
the XML would be deleted from MythTV as well.
Unfortunately I'm finding that programs that are removed from the XML
file (like canceled programs) remain in Myth's upcoming program
listings. Is there a way to fix this? Is there a command equivalent to
"--refresh-all" for the --file function?
I've looked at the output from mythfilldatabase using "-v all" From this
I can see that the missing programs are not included in the 'MSqlQuery:
SELECT * FROM program' phase, but they are updated when "Marking episode
first showings" and "Marking episode first showings" are run.
If anyone could help with this I'd really appreciate it.
</pre>
</blockquote>
<pre wrap="">This mysql command will delete all records in the program table. Then all you
need to do is import your xmltv file again.
DELETE FROM program;
</pre>
</blockquote>
</blockquote>
Thanks--That fixed it for now.<br>
<blockquote cite="mid:46FB6E1A.6010500@thirdcontact.com" type="cite">
<pre wrap=""><!---->
Which, BTW, is basically already done by mythfilldatabase. Rather than
the approach that Jon expected, when mfdb is given new data for a
particular day for a particular video source, all listings for that
source on that day are deleted from the database (on a
channel-by-channel basis), </pre>
</blockquote>
Thanks for the explanation If I'm viewing the output of mfdb -v all,
what would the delete command look like? I ran the command again and
used grep DELETE and here's what I got:<br>
<br>
root@AVPC1:~# mythfilldatabase -v all --file 1 30
/myth/windows/listings/tv30.xml | grep DELETE<br>
2007-09-27 07:09:08.766 MSqlQuery: DELETE FROM mythlog WHERE logid=
3141 ;<br>
Updated programs: 0 Unchanged programs: 1239<br>
2007-09-27 07:09:10.709 MSqlQuery: DELETE FROM oldprogram WHERE airdate
< DATE_SUB(CURRENT_DATE, INTERVAL 320 DAY);<br>
2007-09-27 07:09:10.718 MSqlQuery: DELETE FROM program WHERE starttime
<= DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);<br>
2007-09-27 07:09:10.718 MSqlQuery: DELETE FROM programrating WHERE
starttime <= DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);<br>
2007-09-27 07:09:10.719 MSqlQuery: DELETE FROM programgenres WHERE
starttime <= DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);<br>
2007-09-27 07:09:10.719 MSqlQuery: DELETE FROM credits WHERE starttime
<= DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);<br>
2007-09-27 07:09:10.719 MSqlQuery: DELETE FROM record WHERE (type = 1
OR type = 7 OR type = 8) AND enddate < NOW();<br>
2007-09-27 07:09:10.720 MSqlQuery: DELETE FROM oldfind WHERE findid
< TO_DAYS(NOW()) - 14;<br>
2007-09-27 07:09:10.722 MSqlQuery: DELETE FROM oldrecorded WHERE
recstatus <> -3 AND duplicate = 0 AND endtime <
DATE_SUB(CURRENT_DATE, INTERVAL 10 DAY);<br>
2007-09-27 07:09:10.730 MSqlQuery: DELETE FROM mythlog WHERE logid=
3142 ;<br>
<br>
I don't see where the listings are deleted, so I'm either
misunderstanding these commands, or the delete command is missing for
some reason.<br>
<blockquote cite="mid:46FB6E1A.6010500@thirdcontact.com" type="cite">
<pre wrap="">then the new data is inserted. mfdb does not
update the listings data--it just deletes it then inserts the new.
So, if programs are sticking around, they probably exist in some other
video source or the mfdb command line is specifying a wrong video source
or something.
</pre>
</blockquote>
You can see the current command I'm using above (minus grep of course).
I only use a single source, which I can confirm is source 1. I can also
confirm that there are no other sources in the 'videosource' table. I
run the command in a chron job using the root account.<br>
<br>
Jon<br>
<br>
</body>
</html>