Skip to content

Commit

Permalink
support verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrjones committed Apr 30, 2012
1 parent bcc7c27 commit fbf33da
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/App/MP4Meta/Command/musicvideo.pm
Expand Up @@ -8,6 +8,8 @@ package App::MP4Meta::Command::musicvideo;

use App::MP4Meta -command;

use Try::Tiny;

=head1 SYNOPSIS
mp4meta musicvideo "Michael Jackson vs Prodigy - Bille Girl.m4v"
Expand All @@ -34,6 +36,7 @@ sub opt_spec {
[ "coverfile=s", "The location of the cover image" ],
[ "title=s", "The title of the music video" ],
[ "noreplace", "Don't replace the file - creates a temp file instead" ],
[ "verbose", "Print verbosely" ],
);
}

Expand Down Expand Up @@ -66,13 +69,25 @@ sub execute {
genre => $opt->{genre},
title => $opt->{title},
coverfile => $opt->{coverfile},
verbose => $opt->{verbose},
}
);

for my $file (@$args) {
my $error = $mv->apply_meta($file);
say $error if $error;
say "processing $file" if $opt->{verbose};
my $error;
try {
$error = $mv->apply_meta($file);
}
catch {
$error = "Error applying meta to $file: $_";
}
finally {
say $error if $error;
};
}

say 'done' if $opt->{verbose};
}

1;

0 comments on commit fbf33da

Please sign in to comment.