fix json view, add img_extension
This commit is contained in:
parent
5e44a82408
commit
ecfb2ff28c
2 changed files with 9 additions and 4 deletions
|
@ -11,6 +11,8 @@ import time
|
||||||
from subtitles import time2ms
|
from subtitles import time2ms
|
||||||
|
|
||||||
|
|
||||||
|
img_extension="jpg"
|
||||||
|
|
||||||
def extract_flash_ng(movie_file, flash_file, inpoint, outpoint, width=128, height=96, offset = 0):
|
def extract_flash_ng(movie_file, flash_file, inpoint, outpoint, width=128, height=96, offset = 0):
|
||||||
ext = movie_file.split('.')[-1]
|
ext = movie_file.split('.')[-1]
|
||||||
if ext in ('sub', 'srt'):
|
if ext in ('sub', 'srt'):
|
||||||
|
|
|
@ -18,9 +18,12 @@ def jsonify_ArchiveFile(obj):
|
||||||
result = jsonify_sqlobject( obj )
|
result = jsonify_sqlobject( obj )
|
||||||
#FIXME, possibly do something with the date values
|
#FIXME, possibly do something with the date values
|
||||||
# date, date_added, modDate, pubDate
|
# date, date_added, modDate, pubDate
|
||||||
for key in ('date_added', 'modDate', 'pubDate', 'date'):
|
_key_map= {
|
||||||
result[key] = time.mktime(getattr(obj, key).timetuple())
|
'published': 'pubDate',
|
||||||
|
'modified': 'modDate',
|
||||||
for key in ('id', 'archiveID', 'subtitle_meta_id'):
|
}
|
||||||
|
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)
|
result.pop(key)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue