ignore subtitles with in > out

This commit is contained in:
j 2015-02-05 18:29:18 +05:30
parent ea6a79cc10
commit ed5bc510a9

View file

@ -282,10 +282,11 @@ class File(models.Model):
srt = []
subtitles = []
for s in ox.srt.load(self.data.path):
key = '%s --> %s\n%s' % (s['in'], s['out'], s['value'])
if key not in subtitles:
subtitles.append(key)
srt.append(s)
if s['in'] <= s['out']:
key = '%s --> %s\n%s' % (s['in'], s['out'], s['value'])
if key not in subtitles:
subtitles.append(key)
srt.append(s)
#subtitles should not overlap
for i in range(1, len(srt)):
if srt[i-1]['out'] > srt[i]['in']: