From 8720317a56b667d15cae44f8a917808befbef0b3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 24 Jul 2007 15:26:21 +0000 Subject: [PATCH] port changes to subtitles.py, add cronDaily --- oxdbarchive/cron.py | 4 ++++ oxdbarchive/subtitles.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/oxdbarchive/cron.py b/oxdbarchive/cron.py index 27e0fc0..a832e46 100644 --- a/oxdbarchive/cron.py +++ b/oxdbarchive/cron.py @@ -5,6 +5,10 @@ from model import * +def cronDaily(): + findNew() + extractNew() + def findNew(): archive = Archive.get(1) archive.importFiles() diff --git a/oxdbarchive/subtitles.py b/oxdbarchive/subtitles.py index d21f5dc..f1e8d9d 100644 --- a/oxdbarchive/subtitles.py +++ b/oxdbarchive/subtitles.py @@ -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