Ticket #5420: myth.find_orphans.pl.patch
File myth.find_orphans.pl.patch, 1.4 KB (added by , 16 years ago) |
---|
-
mythtv/contrib/myth.find_orphans.pl
old new 122 122 # look in recorded table, make sure we can find every file .. 123 123 # 124 124 125 my $q = "SELECT title, subtitle, starttime, endtime, chanid, basename FROM recorded WHERE hostname=(?) ORDER BY starttime";125 my $q = "SELECT title, subtitle, description, starttime, endtime, chanid, basename FROM recorded WHERE hostname=(?) ORDER BY starttime"; 126 126 $sth = $dbh->prepare($q); 127 127 $sth->execute($opt_host) || die "Could not execute ($q): $!\n"; 128 128 129 129 while (my @row=$sth->fetchrow_array) { 130 ($title, $subtitle, $ starttime, $endtime, $channel, $basename) = @row;130 ($title, $subtitle, $description ,$starttime, $endtime, $channel, $basename) = @row; 131 131 132 132 # see if we can find it... 133 133 $loc = find_file($basename); … … 136 136 $missing_recordings++; 137 137 138 138 if ($opt_dodbdelete) { 139 my $sql = sprintf "DELETE FROM oldrecorded WHERE title LIKE \"%s\" AND subtitle LIKE \"%s\" AND description LIKE \"%s\" LIMIT 1", $title, $subtitle, $description; 140 printf "unmarking program as recorded: %s\n",$sql; 141 $dbh->do($sql) || die "Could not execute $sql: $!\n"; 139 142 my $sql = sprintf "DELETE FROM recorded WHERE basename LIKE \"%s\" LIMIT 1",$basename; 140 143 printf "performing database delete: %s\n",$sql; 141 144 $dbh->do($sql) || die "Could not execute $sql: $!\n";