Commits

"Jas...@ubib.eur.nl>"  committed fed3132

use real value for earliest datestamp

  • Participants
  • Parent commits 791fd3e

Comments (0)

Files changed (2)

File moai/database.py

             yield {'id': row.set_id,
                    'name': row.name,
                    'description': row.description}
-            
+
+    def oai_earliest_datestamp(self):
+        row = sql.select([self._records.c.modified],
+                         order_by=[sql.asc(self._records.c.modified)]
+                         ).limit(1).execute().fetchone()
+        if row:
+            return row[0]
+        return datetime.datetime(1970, 1, 1)
+    
     def oai_query(self,
                   offset=0,
                   batch_size=20,
             baseURL=self.config.url,
             protocolVersion='2.0',
             adminEmails=self.config.admins,
-            earliestDatestamp=datetime(2001, 1, 1, 10, 00),
+            earliestDatestamp=self.db.oai_earliest_datestamp(),
             deletedRecord='transient',
             granularity='YYYY-MM-DDThh:mm:ssZ',
             compression=['identity'],
             'xmlns="http://oai.dlib.vt.edu/OAI/metadata/toolkit" '
             'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'
             '<title>MOAI</title>'
-            '<author><name>Jasper Op de Coul</name>'
-            '<email>info@infrae.com / moai-dev@lists.infrae.com</email>'
-            '<institution>Infrae</institution></author>'
             '%s'
             '<URL>http://moai.infrae.com</URL>'
             '</toolkit>' % version)