fix json view, add img_extension

This commit is contained in:
j 2008-06-01 22:27:03 +02:00
parent 5e44a82408
commit ecfb2ff28c
2 changed files with 9 additions and 4 deletions

View file

@ -11,6 +11,8 @@ import time
from subtitles import time2ms
img_extension="jpg"
def extract_flash_ng(movie_file, flash_file, inpoint, outpoint, width=128, height=96, offset = 0):
ext = movie_file.split('.')[-1]
if ext in ('sub', 'srt'):

View file

@ -18,9 +18,12 @@ def jsonify_ArchiveFile(obj):
result = jsonify_sqlobject( obj )
#FIXME, possibly do something with the date values
# date, date_added, modDate, pubDate
for key in ('date_added', 'modDate', 'pubDate', 'date'):
result[key] = time.mktime(getattr(obj, key).timetuple())
for key in ('id', 'archiveID', 'subtitle_meta_id'):
_key_map= {
'published': 'pubDate',
'modified': 'modDate',
}
for key in ('date_added', 'published', 'modified', 'date'):
result[_key_map.get(key, key)] = time.mktime(getattr(obj, key).timetuple())
for key in ('id', 'subtitle_meta_id'):
result.pop(key)
return result