Opened 14 years ago

Closed 14 years ago

#857 closed patch (fixed)

Patch to mythrename.pl to work correctly with slave backends

Reported by: tom@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This small patch updates mythrename.pl to use the hostname when deciding what records to process. I only use the --link option, so further testing may be required.

--- /usr/local/src/mythtv/contrib/mythrename.pl 2005-12-22 18:39:06.000000000 -0500
+++ mythrename.pl       2005-12-22 18:39:34.000000000 -0500
@@ -230,9 +230,9 @@
     }

 # Prepare a database queries
-    $q  = 'SELECT * FROM recorded';
+    $q  = 'SELECT * FROM recorded WHERE hostname=?';
     $sh  = $dbh->prepare($q);
-    $sh->execute() or die "Couldn't execute $q:  $!\n";
+    $sh->execute($hostname) or die "Couldn't execute $q:  $!\n";

 # Only if we're renaming files
     unless ($dest) {

I hope I formatted it correctly.

Tom

Attachments (1)

mythrename-locally_accessible_files.patch (699 bytes) - added by sphery <mtdean@…> 14 years ago.
Attached patch for ease of access. Same as the patch Tom posted in his second comment.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 14 years ago by tom@…

A better patch from Mike Dean on the mailing list, that actually does what was intended. This supercedes my patch above.

Index: contrib/mythrename.pl
===================================================================
--- contrib/mythrename.pl	(revision 8364)
+++ contrib/mythrename.pl	(working copy)
@@ -244,6 +244,7 @@
     while (my $ref = $sh->fetchrow_hashref()) {
         my %info = %{$ref};
         die "This script requires mythtv >= 0.19\n" unless ($info{'basename'});
+        next unless (-e "$video_dir/".$info{'basename'});
     # Default times
         my ($syear, $smonth, $sday, $shour, $sminute, $ssecond) = $info{'starttime'} =~ /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/;
         my ($eyear, $emonth, $eday, $ehour, $eminute, $esecond) = $info{'endtime'}   =~ /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/;

Changed 14 years ago by sphery <mtdean@…>

Attached patch for ease of access. Same as the patch Tom posted in his second comment.

comment:2 Changed 14 years ago by tom@…

Resolution: invalid
Status: newclosed

Better (larger) patch to come.

comment:3 Changed 14 years ago by tom@…

Resolution: invalid
Status: closedreopened

Reopening, and splitting up other patches for easier application. Please use the patch attached to this ticket by mtdean@….

Sorry for the flipping back and forth, it's my first patch.

Tom

comment:4 Changed 14 years ago by cpinkham

Resolution: fixed
Status: reopenedclosed

(In [8396]) Modify mythrename.pl to ignore non-existent files. Patch from and closes #857.

Note: See TracTickets for help on using tickets.