port changes to subtitles.py, add cronDaily

This commit is contained in:
j 2007-07-24 15:26:21 +00:00
parent e14b0aabcd
commit 8720317a56
2 changed files with 6 additions and 2 deletions

View file

@ -5,6 +5,10 @@
from model import * from model import *
def cronDaily():
findNew()
extractNew()
def findNew(): def findNew():
archive = Archive.get(1) archive = Archive.get(1)
archive.importFiles() archive.importFiles()

View file

@ -33,8 +33,8 @@ def srt2dict(srt, encoding = "utf-8"):
start_stop = subtitle[1].split(' --> ') start_stop = subtitle[1].split(' --> ')
subtitle[0] =u"%s" % int(subtitle[0]) subtitle[0] =u"%s" % int(subtitle[0])
subdict[subtitle[0]] = { subdict[subtitle[0]] = {
'start': start_stop[0], 'start': start_stop[0].replace('.', ','),
'stop': start_stop[1], 'stop': start_stop[1].replace('.', ','),
'text': u'\n'.join(subtitle[2:]), 'text': u'\n'.join(subtitle[2:]),
} }
return subdict return subdict