Permalink
Browse files

prevent duplicates and be verbose

  • Loading branch information...
1 parent 070472e commit 2d8123f41d79800473e0dd11f9c76f619982aeef @halkeye committed Jun 26, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 fixMythbusters.pl
View
2 fixMythbusters.pl 100644 → 100755
@@ -20,6 +20,7 @@
{
my $info = $tvdb->getEpisode($series, $season, $epNum);
next unless $info->{'EpisodeName'};
+ die "Duplicate named ep - $info->{'EpisodeName'}" if $realEpMap->{$info->{'EpisodeName'}};
$realEpMap->{$info->{'EpisodeName'}} = {
'epNum' => $info->{'EpisodeNumber'},
@@ -67,6 +68,7 @@
my $newFileName = sprintf("%s - S%02dE%02d - %s%s",
$series, $info->{season}, $info->{epNum}, $row->{epName}, $suffix
);
+ warn($oldFilename, " /home/halkeye/downloads/MythBusters/$newFileName\n");
File::Copy::copy($oldFilename, "/home/halkeye/downloads/MythBusters/$newFileName")
or warn("unable to copy $oldFilename: $!");
}

0 comments on commit 2d8123f

Please sign in to comment.