=================================================================== RCS file: /cvs/wpscripts/ztransfer/fetch.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- wpscripts/ztransfer/fetch.pm 2011/08/30 08:30:41 1.6 +++ wpscripts/ztransfer/fetch.pm 2011/12/21 10:19:26 1.7 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: fetch.pm,v 1.6 2011/08/30 08:30:41 yason Exp $ +# $Id: fetch.pm,v 1.7 2011/12/21 10:19:26 yason Exp $ package fetch; use db; use log; # bad! only for log::filelist() @@ -7,6 +7,7 @@ my $QUERY_Z = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=0"; my $QUERY_P = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=1"; my $QUERY_T = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=2"; +my $QUERY_J = "SELECT ID,Path,file_priority FROM upload_files WHERE Status=0 AND type_file=3"; my $sth; @@ -140,6 +141,31 @@ return( (\@dbids, \@dbpaths) ); } +sub jpeg_list() +{ + my @dbids; + my @dbpaths; + my $i = 0; + $sth = $db::dbh->prepare($QUERY_J); + $sth->execute( ); + while(($dbids[$i], $dbpaths[$i]) = $sth->fetchrow_array( ) ) + { + $dbpaths[$i] = substr($dbpaths[$i], 13); + $dbpaths[$i] =~ tr/\\/\//; + $dbpaths[$i] = '/mnt/maket/' . $dbpaths[$i]; + $dbpaths[$i] = substr($dbpaths[$i], 0, ( index($dbpaths[$i], ' ', 0) ) ); + $i++; + } + + $i--; + $#dbids = $i; + $#dbpaths = $i; + + log::filelist(\@dbpaths); + + + return( (\@dbids, \@dbpaths) ); +} return(1);