summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-01-11 18:07:16 +0100
committerGuilhem Moulin <guilhem.moulin@ens-lyon.org>2012-01-11 18:07:16 +0100
commit7afca45ce9dc21300cffa2d6636eb0d69eecf1cb (patch)
tree044526a4eb7100bf983df6d22a6a1ab36314f680
parenta953f64925b6e1031d11502b6629cc6010812ffc (diff)
more checks
-rwxr-xr-xvideodb-check.pl20
1 files changed, 18 insertions, 2 deletions
diff --git a/videodb-check.pl b/videodb-check.pl
index f56a090..8acff46 100755
--- a/videodb-check.pl
+++ b/videodb-check.pl
@@ -85,6 +85,11 @@ the database.
Each symlink in the directory I<MOVIES> of your collection has exactly
one corresponding entry in the database.
+=item *
+
+No movie in the database has invalid release date, empty title or empty
+language.
+
=back
=head1 CONFIGURATION
@@ -214,15 +219,18 @@ foreach (@filelist) {
push @files, $_ unless $#res == 0;
}
$sth->finish;
-$dbh->disconnect;
+&report ("The following files have <> 1 corresponding entries in the DB", \@files);
-&report ("The following files have <> 1 corresponding entries in the DB", \@files);
+&check ( "no release date", "year = 0" );
+&check ( "no language set", "language IS NULL OR language =''" );
+&check ( "no title set", "title IS NULL OR title =''" );
################################################################################
+$dbh->disconnect;
exit $r;
@@ -239,3 +247,11 @@ sub report {
$r = 1;
}
}
+
+sub check {
+ my $bad = $dbh->selectall_arrayref( "SELECT filename
+ FROM $config{videodata}
+ WHERE " .$_[1] )
+ or die "Can't select: " .$dbh->errstr. "\n";
+ &report ("The following files have " .$_[0], [map {$_->[0]} @$bad]);
+}