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 *
def cronDaily():
findNew()
extractNew()
def findNew():
archive = Archive.get(1)
archive.importFiles()

View File

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