dont import empty subtitles

This commit is contained in:
j 2015-02-06 10:57:14 +05:30
parent b497b44614
commit 243c1958c1

View file

@ -282,7 +282,7 @@ 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):
if s['in'] <= s['out']: if s['in'] <= s['out'] and s['value'].strip():
key = '%s --> %s\n%s' % (s['in'], s['out'], s['value']) key = '%s --> %s\n%s' % (s['in'], s['out'], s['value'])
if key not in subtitles: if key not in subtitles:
subtitles.append(key) subtitles.append(key)