summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 12:40:19 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-02-18 12:40:19 +0100
commitad7f7236e3a5db146dc00d490a989dc0eba3273d (patch)
tree52f08f9a8a23b4eef59bf9311902b07b2d6a347d
parent9e6435fa81a64f11e9b50c704d367cd9e135235b (diff)
custom genres
-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';
}