From 2104ff97d6eb5a76af7778dfa51ea3c8fefbb207 Mon Sep 17 00:00:00 2001 From: Karl Dietz Date: Sun, 29 May 2011 17:53:05 +0200 Subject: [PATCH] test augmenter with current date, silence some output --- test/augment.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/augment.pl b/test/augment.pl index 91ca1fb..613d3bd 100755 --- a/test/augment.pl +++ b/test/augment.pl @@ -6,12 +6,20 @@ use utf8; use FindBin; use lib "$FindBin::Bin/../lib"; +use DateTime; use Data::Dumper; use Encode; #use NonameTV::Augmenter::Tvdb; use NonameTV::Factory qw/CreateAugmenter CreateDataStore CreateDataStoreDummy /; my $ds = CreateDataStore( ); + +my $dt = DateTime->now( time_zone => 'UTC' ); +$dt->add( days => 7 ); + +my $batchid = 'neo.zdf.de_' . $dt->week_year() . '-' . $dt->week(); +printf( "augmenting %s...\n", $batchid ); + my $augmenter = CreateAugmenter( 'Tvdb', $ds ); # program metadata from augmenter @@ -28,10 +36,8 @@ my %simplerule = ( matchby => 'episodetitle' ); AND (b.name LIKE ?) ORDER BY start_time asc, end_time desc", # name of batch to use for testing - ['neo.zdf.de_2011-13'] ); + [$batchid] ); - my @result; - my $found=0; my $notfound=0; my $ce = $sth->fetchrow_hashref(); @@ -42,10 +48,8 @@ my %simplerule = ( matchby => 'episodetitle' ); $ce->{subtitle} =~ s|\s\(Teil (\d+)\)$| ($1)|; ( $newprogram, $result ) = $augmenter->AugmentProgram( $ce, \%simplerule ); if( defined( $newprogram) ) { - printf( "'%s: %s' found\n", $ce->{title}, $ce->{subtitle} ); $found++; } else { - printf( "'%s: %s' not found\n", $ce->{title}, $ce->{subtitle} ); $notfound++; } } -- 2.11.4.GIT