Author: dmeyer
Date: Sun Sep 16 06:09:59 2007
New Revision: 2819

Log:
adjust to kaa.metadata date changes

Modified:
   trunk/beacon/src/server/feedmanager/rss.py
   trunk/beacon/src/server/parser.py
   trunk/beacon/src/server/server.py

Modified: trunk/beacon/src/server/feedmanager/rss.py
==============================================================================
--- trunk/beacon/src/server/feedmanager/rss.py  (original)
+++ trunk/beacon/src/server/feedmanager/rss.py  Sun Sep 16 06:09:59 2007
@@ -49,15 +49,16 @@
             if feedimage:
                 metadata['image'] = feedimage
             if 'updated' in f.keys():
-                date = f.updated
-                if date.find('+') > 0:
-                    date = date[:date.find('+')].strip()
-                if date.rfind(' ') > date.rfind(':'):
-                    date = date[:date.rfind(' ')]
+                timestamp = f.updated
+                if timestamp.find('+') > 0:
+                    timestamp = timestamp[:timestamp.find('+')].strip()
+                if timestamp.rfind(' ') > timestamp.rfind(':'):
+                    timestamp = timestamp[:timestamp.rfind(' ')]
                 try:
-                    metadata['date'] = int(time.mktime(time.strptime(date, 
isotime)))
+                    t = time.strptime(timestamp, isotime)
+                    metadata['timestamp'] = int(time.mktime(t))
                 except ValueError:
-                    log.error('bad date format: %s', date)
+                    log.error('bad "updated" string: %s', timestamp)
                     
             if 'itunes_duration' in f.keys():
                 duration = 0

Modified: trunk/beacon/src/server/parser.py
==============================================================================
--- trunk/beacon/src/server/parser.py   (original)
+++ trunk/beacon/src/server/parser.py   Sun Sep 16 06:09:59 2007
@@ -305,11 +305,6 @@
         for function in extention_plugins[ext]:
             function(item, attributes)
 
-    # FIXME: this should not be needed if kaa.metadata works correctly
-    attributes['date'] = 0
-    if metadata.get('date') and isinstance(metadata.get('date'), int):
-        attributes['date'] = metadata.get('date')
-
     while db.read_lock.is_locked():
         # wait for the db to be free for write access
         yield db.read_lock.yield_unlock()

Modified: trunk/beacon/src/server/server.py
==============================================================================
--- trunk/beacon/src/server/server.py   (original)
+++ trunk/beacon/src/server/server.py   Sun Sep 16 06:09:59 2007
@@ -93,7 +93,7 @@
             height = (int, ATTR_SIMPLE),
             length = (float, ATTR_SIMPLE),
             scheme = (int, ATTR_SIMPLE),
-            date = (int, ATTR_SEARCHABLE))
+            timestamp = (int, ATTR_SEARCHABLE))
 
         self.register_file_type_attrs("audio",
             title = (unicode, ATTR_KEYWORDS | ATTR_IGNORE_CASE),
@@ -104,7 +104,8 @@
             length = (float, ATTR_SIMPLE),
             bitrate = (int, ATTR_SIMPLE),
             trackno = (int, ATTR_SIMPLE),
-            date = (int, ATTR_SEARCHABLE))
+            userdate = (unicode, ATTR_SIMPLE),
+            timestamp = (int, ATTR_SEARCHABLE))
 
         self.register_file_type_attrs("image",
             width = (int, ATTR_SEARCHABLE),
@@ -112,7 +113,7 @@
             comment = (unicode, ATTR_KEYWORDS | ATTR_IGNORE_CASE),
             rotation = (int, ATTR_SIMPLE),
             author = (unicode, ATTR_SIMPLE),
-            date = (int, ATTR_SEARCHABLE))
+            timestamp = (int, ATTR_SEARCHABLE))
 
         # tracks for rom discs or iso files
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to