Ticket #1046: mythrename-live.diff
File mythrename-live.diff, 1.6 KB (added by , 18 years ago) |
---|
-
mythtv/contrib/mythrename.pl
22 22 use File::Path; 23 23 24 24 # Some variables we'll use here 25 our ($dest, $format, $usage, $underscores );25 our ($dest, $format, $usage, $underscores, $live); 26 26 our ($dformat, $dseparator, $dreplacement, $separator, $replacement); 27 27 our ($db_host, $db_user, $db_name, $db_pass, $video_dir, $verbose); 28 28 our ($hostname, $dbh, $sh, $sh2, $q, $q2, $count); … … 42 42 # Load the cli options 43 43 GetOptions('link|dest|destination|path:s' => \$dest, 44 44 'format=s' => \$format, 45 'live' => \$live, 45 46 'separator=s' => \$separator, 46 47 'replacement=s' => \$replacement, 47 48 'usage|help|h' => \$usage, … … 65 66 66 67 /var/video/show_names/ 67 68 69 --live 70 71 Include live tv recordings, affects both linking and renaming. This assumes 72 that recgroup = "LiveTV" for live tv recordings. 73 74 default: do not link/rename live tv recordings 75 68 76 --format 69 77 70 78 default: $dformat … … 239 247 } 240 248 241 249 # Prepare a database queries 242 $q = 'SELECT * FROM recorded'; 250 if (defined($live)) { 251 $q = 'SELECT * FROM recorded'; 252 } else { 253 $q = 'SELECT * FROM recorded where recgroup != "LiveTV"'; 254 } 243 255 $sh = $dbh->prepare($q); 244 256 $sh->execute() or die "Couldn't execute $q: $!\n"; 245 257