--- loncom/metadata_database/searchcat.pl 2004/08/30 14:31:42 1.60 +++ loncom/metadata_database/searchcat.pl 2005/03/09 18:22:19 1.61 @@ -2,7 +2,7 @@ # The LearningOnline Network # searchcat.pl "Search Catalog" batch script # -# $Id: searchcat.pl,v 1.60 2004/08/30 14:31:42 matthew Exp $ +# $Id: searchcat.pl,v 1.61 2005/03/09 18:22:19 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -321,8 +321,9 @@ sub process_meta_file { my $ref=&metadata($filename); # # $url is the original file url, not the metadata file - my $url='/res/'.&declutter($filename); - $url=~s/\.meta$//; + my $target = $filename; + $target =~ s/\.meta$//; + my $url='/res/'.&declutter($target); &log(3," ".$url) if ($debug); # # Ignore some files based on their metadata @@ -347,6 +348,14 @@ sub process_meta_file { &count_type($url); } # + if (! defined($ref->{'creationdate'}) || + $ref->{'creationdate'} =~ /^\s*$/) { + $ref->{'creationdate'} = (stat($target))[9]; + } + if (! defined($ref->{'lastrevisiondate'}) || + $ref->{'lastrevisiondate'} =~ /^\s*$/) { + $ref->{'lastrevisiondate'} = (stat($target))[9]; + } $ref->{'creationdate'} = &sqltime($ref->{'creationdate'}); $ref->{'lastrevisiondate'} = &sqltime($ref->{'lastrevisiondate'}); my %Data = (