cleanup subtitles while parsing
This commit is contained in:
parent
879ebf9343
commit
28796b80ba
1 changed files with 2 additions and 0 deletions
|
@ -230,6 +230,8 @@ class File(models.Model):
|
||||||
for s in srts.findall(data):
|
for s in srts.findall(data):
|
||||||
_s = {'id': str(i),
|
_s = {'id': str(i),
|
||||||
'in': parseTime(s[0]), 'out': parseTime(s[1]), 'value': s[2].strip()}
|
'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)
|
srt.append(_s)
|
||||||
i += 1
|
i += 1
|
||||||
return srt
|
return srt
|
||||||
|
|
Loading…
Reference in a new issue