[LON-CAPA-cvs] cvs: loncom /metadata_database searchcat.pl

www lon-capa-cvs@mail.lon-capa.org
Mon, 05 Jan 2004 15:54:22 -0000


www		Mon Jan  5 10:54:22 2004 EDT

  Modified files:              
    /loncom/metadata_database	searchcat.pl 
  Log:
  * Do not catalog directory metadata under "default"
  * Get rid of 1969 as "dates"
  
  
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.53 loncom/metadata_database/searchcat.pl:1.54
--- loncom/metadata_database/searchcat.pl:1.53	Sat Dec 27 18:04:28 2003
+++ loncom/metadata_database/searchcat.pl	Mon Jan  5 10:54:22 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.53 2003/12/27 23:04:28 www Exp $
+# $Id: searchcat.pl,v 1.54 2004/01/05 15:54:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -388,8 +388,13 @@
         $m2=~s/\.meta$//;
  	if ($ref->{'obsolete'}) { print LOG "obsolete\n"; next; }
 	if ($ref->{'copyright'} eq 'private') { print LOG "private\n"; next; }
-        my %dyn=&dynamicmeta($m2);
-	&count($m2);
+	my %dyn=();
+	if ($m2=~/\/default$/) {
+	    $m2=~s/\/default$/\//;
+	} else {
+	    %dyn=&dynamicmeta($m2);
+	    &count($m2);
+	}
         unless ($insert_sth->execute(
 			     $ref->{'title'},
                              $ref->{'author'},
@@ -550,8 +555,10 @@
 
 # ---------------------------- convert 'time' format into a datetime sql format
 sub sqltime {
+    my $time=&unsqltime(@_[0]);
+    unless ($time) { return 'NULL'; }
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
-	localtime(&unsqltime(@_[0]));
+	localtime($time);
     $mon++; $year+=1900;
     return "$year-$mon-$mday $hour:$min:$sec";
 }