From ad7f7236e3a5db146dc00d490a989dc0eba3273d Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 18 Feb 2012 12:40:19 +0100 Subject: custom genres --- videoadd.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'videoadd.pl') 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). =item B<-o> I Override data with the I provided. -I is one of I, 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'; } -- cgit v1.2.3