Modify

Ticket #2877 (closed patch: fixed)

Opened 6 years ago

Last modified 6 years ago

Attempt to use guide data when recovering recordings

Reported by: mikal@… Owned by: awithers
Priority: minor Milestone: unknown
Component: mythtv Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

While recovering an accidentally deleted MySQL database, I needed to modify myth.rebuilddatabase.pl to use guide data if possible to recover the title, subtitle and description of shows I didn't have the SQL for any more. Here's the patch:

Index: myth.rebuilddatabase.pl =================================================================== --- myth.rebuilddatabase.pl (revision 11681) +++ myth.rebuilddatabase.pl (working copy) @@ -185,6 +185,7 @@

'norename'=>\$norename );

+print "db = dbi:mysql:database=$database:host=$dbhost user = $user pass = $pass\n";

my $dbh = DBI->connect("dbi:mysql:database=$database:host=$dbhost",

"$user","$pass") or die "Cannot connect to database ($!)\n";

@@ -314,6 +315,7 @@

# have enough to look for an past recording? if ($ssecond) {

+ print "Checking for a recording...\n";

$starttime = "$syear$smonth$sday$shour$sminute$ssecond";

my $guess = "select title, subtitle, description from oldrecorded where chanid=(?) and starttime=(?)";

@@ -333,6 +335,24 @@

print "End time: $emonth/$eday/$eyear - $ehour:$eminute:$esecond\n";

}

+ # what about checking for guide data? + if($guess_description =~ /Recovered file/) { + print "Checking for guide data...\n"; + my $guess = "select title, subtitle, description from program where chanid='$channel'". + " and starttime='$syear-$smonth-$sday $shour:$sminute:$ssecond'"; + print "$guess\n"; + $sth = $dbh->prepare($guess); + $sth->execute() + or die "Could not execute ($guess)\n"; + + if (my @row = $sth->fetchrow_array) { + $guess_title = $row[0]; + $guess_subtitle = $row[1]; + $guess_description = $row[2]; + print "Using guide data informaton for defaults\n"; + } + } +

my $newtitle = $guess_title; my $newsubtitle = $guess_subtitle; my $newdescription = $guess_description;

Attachments

myth.rebuilddatabase.pl.patch (1.7 KB) - added by anonymous 6 years ago.

Change History

Changed 6 years ago by anonymous

comment:1 Changed 6 years ago by stuartm

  • Type changed from defect to patch

comment:2 Changed 6 years ago by awithers

  • Owner changed from ijr to awithers

comment:3 Changed 6 years ago by awithers

  • Status changed from new to closed
  • Resolution set to fixed

(In [13414]) Closes #2877

This patch allows myth.rebuilddatabase.pl to search existing guide data for recording information.

comment:4 Changed 6 years ago by ijr

  • Ticket locked set

comment:5 Changed 6 years ago by anonymous

Testing.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.