xmltv/filter tv_imdb,1.32,1.33

Jerry Veldhuis <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/filter
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30381/filter

Modified Files:
	tv_imdb 
Log Message:
minor perldoc cleanup
added --validate-title <title> --validate-year <year> for quick db checks
cleaned up alternative titles code


Index: tv_imdb
===================================================================
RCS file: /cvsroot/xmltv/xmltv/filter/tv_imdb,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** tv_imdb	21 Feb 2015 04:59:17 -0000	1.32
--- tv_imdb	8 Mar 2015 19:46:34 -0000	1.33
***************
*** 18,21 ****
--- 18,27 ----
         [--output FILE] [FILE...]
  
+ tv_imdb --imdbdir <dir>
+         --validate-title 'movie title'
+         --validate-year 2004
+         [--with-keywords] [--with-plot]
+         [--debug]
+ 
  =head1 DESCRIPTION
  
***************
*** 83,87 ****
  is listed in the imdb.com data (because some tv series have > 30 directors)
  
! B<6.> the top 3 billing actors are added.
  
  B<7.> genres added to E<39>categoriesE<39> field (current list of genres are
--- 89,93 ----
  is listed in the imdb.com data (because some tv series have > 30 directors)
  
! B<6.> the top 3 billing actors are added (use -actors [num] to adjust).
  
  B<7.> genres added to E<39>categoriesE<39> field (current list of genres are
***************
*** 92,98 ****
  B<8.> imdb user ratings added to E<39>star-ratingsE<39> field.
  
! B<9.> imdb keywords added to E<39>keywordE<39> fields.
  
! B<10.> imdb plot summary is added.
  
  =head1 HOWTO
--- 98,104 ----
  B<8.> imdb user ratings added to E<39>star-ratingsE<39> field.
  
! B<9.> imdb keywords added to E<39>keywordE<39> fields (if --with-keywords used).
  
! B<10.> imdb plot summary is added (if --with-plot used).
  
  =head1 HOWTO
***************
*** 119,122 ****
--- 125,135 ----
  Feel free to report any problems with these steps to [email protected].
  
+ =head1 TESTING
+ 
+ The --validate-title and --validate-year flags can be used to validate the
+ information in the tv_imdb database. For exmple:
+ 
+    tv_imdb --imdbdir . --validate-title 'Army of Darness' --validate-year 1994
+ 
  =head1 BUGS
  
***************
*** 192,195 ****
--- 205,210 ----
      $opt_with_plot,
      $opt_num_actors,
+     $opt_validate_title,
+     $opt_validate_year,
     );
  
***************
*** 205,209 ****
  	   'download' => \$opt_download,
  	   'stats'         => \$opt_stats,
! 	   'debug'         => \$opt_debug,
  	   ) or usage(0);
  
--- 220,226 ----
  	   'download' => \$opt_download,
  	   'stats'         => \$opt_stats,
! 	   'debug+'         => \$opt_debug,
! 	   'validate-title=s' => \$opt_validate_title,
! 	   'validate-year=s'  => \$opt_validate_year,
  	   ) or usage(0);
  
***************
*** 303,306 ****
--- 320,350 ----
  }
  
+ if ( defined($opt_validate_title) != defined($opt_validate_year) ) {
+     print STDERR "tv_imdb: both --validate-title and --validate-year must be used together\n";
+     exit(1);
+ }
+ 
+ if ( defined($opt_validate_title) && defined($opt_validate_year)  ) {
+     my $prog;
+ 
+     $prog->{title}->[0]->[0]=$opt_validate_title;
+     $prog->{date}=$opt_validate_year;
+     $imdb->{updateTitles}=0;
+ 
+     #print Dumper($prog);
+     my $n=$imdb->augmentProgram($prog, $opt_movies_only);
+     if ( $n ) {
+ 	$Data::Dumper::Sortkeys = 1; # ensure consistent order of dumped hash
+ 	#my $encoding;
+ 	#my $w = new XMLTV::Writer((), encoding => $encoding);
+ 	#$w->start(shift);
+ 	#$w->write_programme($n);
+ 	print Dumper($n);
+ 	#$w->end();
+     }
+     $imdb->closeMovieIndex();
+     exit(0);
+ }
+ 
  # test that movie database works okay
  my %w_args = ();


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.