From 5b1d370ec0f13cf7e884cad60d38d155e1064ebf Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 15 Jun 2011 12:08:15 +0200 Subject: [PATCH] cleanup subtitles while parsing --- pandora/archive/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index bda7f0e..a3d79e5 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -230,6 +230,8 @@ class File(models.Model): for s in srts.findall(data): _s = {'id': str(i), 'in': parseTime(s[0]), 'out': parseTime(s[1]), 'value': s[2].strip()} + if srt and srt[-1]['out'] > _s['in']: + srt[-1]['out'] = _s['in'] srt.append(_s) i += 1 return srt