diff --git a/trunk/init_sql.pl b/trunk/init_sql.pl index 75e6daf..a5dac66 100644 --- a/trunk/init_sql.pl +++ b/trunk/init_sql.pl @@ -75,10 +75,10 @@ $dbh->do(qq{create table coverage varchar(255) not null, rights varchar(255) not null, license varchar(255) not null, - filesize int not null, - duration int not null, - width smallint not null, - height smallint not null, + filesize int default -1, + duration int default -1, + width smallint default -1, + height smallint default -1, fps float not null, hash char(64) not null, primary key (id) diff --git a/trunk/tools/daemon.pl b/trunk/tools/daemon.pl index fbf6c3c..0bdf81f 100755 --- a/trunk/tools/daemon.pl +++ b/trunk/tools/daemon.pl @@ -43,7 +43,7 @@ while(1) { #get fresh video id from db my $sth = $dbh->prepare(qq{select id, filesize, duration, width, height, fps, hash - from uploaded where duration != 0 and width != 0 and height != 0 limit 1}) or interrupt $dbh->errstr; + from uploaded where filesize != -1 and duration != -1 and width != -1 and height != -1 limit 1}) or interrupt $dbh->errstr; $sth->execute() or interrupt $dbh->errstr; my ($id,$filesize, $duration, $width, $height, $fps, $sha) = $sth->fetchrow_array();