summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xvideoadd.pl13
1 files changed, 9 insertions, 4 deletions
diff --git a/videoadd.pl b/videoadd.pl
index 3ff2715..c8eb415 100755
--- a/videoadd.pl
+++ b/videoadd.pl
@@ -120,8 +120,8 @@ added to the database (unless overriden by B<-o> I<key=value>).
=item B<-o> I<key=value>
Override data with the I<value> provided.
-I<key> is one of I<title>, I<language >, I<imdbid>, I<year>, I<imgurl>,
-I<director>, I<actors>, I<country>, I<plot>, I<rating>, I<istv>.
+Valid I<key>s are I<title>, I<language >, I<imdbid>, I<year>, I<imgurl>,
+I<director>, I<genres>, I<country>, I<plot>, I<rating>, I<istv>.
=item B<-q>, B<--quiet>
@@ -268,8 +268,13 @@ elsif (defined $file) {
# Override imdDB's information with the ones provided
-foreach (keys %options) {
- $new{$_} = $options{$_};
+foreach my $k (keys %options) {
+ die "Error: Key `" .$k. "' is not allowed.\n"
+ unless grep { $_ eq $k }
+ qw/title language imdbid year imgurl genres
+ director country plot rating istv/;
+ $new{$k} = $options{$k};
+ $new{$k} = [ split /,\s*/, $new{$k} ] if $k eq 'genres';
}