Ticket #646: myth.rebuild.database-basename_progstart_progend.patch
File myth.rebuild.database-basename_progstart_progend.patch, 3.0 KB (added by , 18 years ago) |
---|
-
contrib/myth.rebuilddatabase.pl
234 234 print(" File: '$show'\n"); 235 235 print(" Title: '$found_title'\n"); 236 236 } else { 237 my $basename = $show; 238 $basename =~ s/$dir\/(.*)/$1/s; 239 237 240 my $guess = "select title, subtitle, description from oldrecorded where chanid=(?) and starttime=(?) and endtime=(?)"; 238 241 $sth = $dbh->prepare($guess); 239 242 $sth->execute($channel, $starttime, $endtime) … … 278 281 } 279 282 280 283 ## add records to db 281 my $i = "insert into recorded (chanid, starttime, endtime, title, subtitle, description, hostname ) values ((?), (?), (?), (?), (?), (?), (?))";284 my $i = "insert into recorded (chanid, starttime, endtime, title, subtitle, description, hostname, basename, progstart, progend) values ((?), (?), (?), (?), (?), (?), (?), (?), (?), (?))"; 282 285 283 286 $sth = $dbh->prepare($i); 284 287 if (!$test_mode) { 285 288 $sth->execute($channel, $starttime, $endtime, $newtitle, 286 $newsubtitle, $newdescription, $host) 289 $newsubtitle, $newdescription, $host, $basename, 290 $starttime, $endtime) 287 291 or die "Could not execute ($i)\n"; 288 292 } else { 289 293 print("Test mode: insert would have been done\n"); 290 294 print(" Query: '$i'\n"); 291 295 print(" Query params: '$channel', '$starttime', '$endtime',"); 292 print("'$newtitle', '$newsubtitle', '$newdescription', '$host'\n"); 296 print("'$newtitle', '$newsubtitle', '$newdescription',"); 297 print("'$host', '$basename', '$starttime', '$endtime'\n"); 293 298 294 299 } 295 300 } ## if … … 299 304 print("Do you want to import? (y/n): "); 300 305 chomp(my $do_import = <STDIN>); 301 306 if ($do_import eq "y") { 307 my $basename = $show; 308 $basename =~ s/$dir\/(.*)/$1/s; 309 302 310 print("Enter channel: "); 303 311 chomp(my $tmp_channel = <STDIN>); 304 312 if ($tmp_channel) {$channel = $tmp_channel;} … … 324 332 if ($tmp_description) {$description = $tmp_description;} 325 333 326 334 ## add records to db 327 my $i = "insert into recorded (chanid, starttime, endtime, title, subtitle, description, hostname ) values ((?), (?), (?), (?), (?), (?), (?))";335 my $i = "insert into recorded (chanid, starttime, endtime, title, subtitle, description, hostname, basename, progstart, progend) values ((?), (?), (?), (?), (?), (?), (?), (?), (?), (?))"; 328 336 329 337 $sth = $dbh->prepare($i); 330 338 if (!$test_mode) { 331 339 $sth->execute($channel, $starttime, $endtime, $title, 332 $subtitle, $description, $host) 340 $subtitle, $description, $host, $basename, 341 $starttime, $endtime) 333 342 or die "Could not execute ($i)\n"; 334 343 } else { 335 344 print("Test mode: insert would have been done\n"); 336 345 print(" Query: '$i'\n"); 337 346 print(" Query params: '$channel', '$starttime', '$endtime',"); 338 print("'$title', '$subtitle', '$description', '$host'\n"); 347 print("'$title', '$subtitle', '$description', '$host',"); 348 print("'$basename', '$starttime', '$endtime'\n"); 339 349 340 350 } 341 351