ignore subtitles with in > out
This commit is contained in:
parent
ea6a79cc10
commit
ed5bc510a9
1 changed files with 5 additions and 4 deletions
|
@ -282,10 +282,11 @@ class File(models.Model):
|
||||||
srt = []
|
srt = []
|
||||||
subtitles = []
|
subtitles = []
|
||||||
for s in ox.srt.load(self.data.path):
|
for s in ox.srt.load(self.data.path):
|
||||||
key = '%s --> %s\n%s' % (s['in'], s['out'], s['value'])
|
if s['in'] <= s['out']:
|
||||||
if key not in subtitles:
|
key = '%s --> %s\n%s' % (s['in'], s['out'], s['value'])
|
||||||
subtitles.append(key)
|
if key not in subtitles:
|
||||||
srt.append(s)
|
subtitles.append(key)
|
||||||
|
srt.append(s)
|
||||||
#subtitles should not overlap
|
#subtitles should not overlap
|
||||||
for i in range(1, len(srt)):
|
for i in range(1, len(srt)):
|
||||||
if srt[i-1]['out'] > srt[i]['in']:
|
if srt[i-1]['out'] > srt[i]['in']:
|
||||||
|
|
Loading…
Reference in a new issue