Ticket #2877: myth.rebuilddatabase.pl.patch
File myth.rebuilddatabase.pl.patch, 1.7 KB (added by , 16 years ago) |
---|
-
myth.rebuilddatabase.pl
185 185 'norename'=>\$norename 186 186 ); 187 187 188 print "db = dbi:mysql:database=$database:host=$dbhost user = $user pass = $pass\n"; 188 189 my $dbh = DBI->connect("dbi:mysql:database=$database:host=$dbhost", 189 190 "$user","$pass") or die "Cannot connect to database ($!)\n"; 190 191 … … 314 315 315 316 # have enough to look for an past recording? 316 317 if ($ssecond) { 318 print "Checking for a recording...\n"; 317 319 $starttime = "$syear$smonth$sday$shour$sminute$ssecond"; 318 320 319 321 my $guess = "select title, subtitle, description from oldrecorded where chanid=(?) and starttime=(?)"; … … 333 335 print "End time: $emonth/$eday/$eyear - $ehour:$eminute:$esecond\n"; 334 336 } 335 337 338 # what about checking for guide data? 339 if($guess_description =~ /^Recovered file/) { 340 print "Checking for guide data...\n"; 341 my $guess = "select title, subtitle, description from program where chanid='$channel'". 342 " and starttime='$syear-$smonth-$sday $shour:$sminute:$ssecond'"; 343 print "$guess\n"; 344 $sth = $dbh->prepare($guess); 345 $sth->execute() 346 or die "Could not execute ($guess)\n"; 347 348 if (my @row = $sth->fetchrow_array) { 349 $guess_title = $row[0]; 350 $guess_subtitle = $row[1]; 351 $guess_description = $row[2]; 352 print "Using guide data informaton for defaults\n"; 353 } 354 } 355 336 356 my $newtitle = $guess_title; 337 357 my $newsubtitle = $guess_subtitle; 338 358 my $newdescription = $guess_description;