rounding issues

This commit is contained in:
j 2017-08-30 16:10:35 +02:00
parent 856129d471
commit e25fb42d2d

View file

@ -180,10 +180,10 @@ def render_subtitles(item_json, output_json, output_srt, lang):
def overlaps(src, other): def overlaps(src, other):
src_in = float('%0.3f' % src['in']) src_in = float('%0.2f' % src['in'])
src_out = float('%0.3f' % src['out']) src_out = float('%0.2f' % src['out'])
other_in = float('%0.3f' % other['in']) other_in = float('%0.2f' % other['in'])
other_out = float('%0.3f' % other['out']) other_out = float('%0.2f' % other['out'])
points = [] points = []
if src_in != other_in or src_out != other_out: if src_in != other_in or src_out != other_out:
# src inside # src inside
@ -193,6 +193,7 @@ def overlaps(src, other):
points += [other['out']] points += [other['out']]
return points return points
if __name__ == '__main__': if __name__ == '__main__':
if os.path.exists('subtitles.json'): if os.path.exists('subtitles.json'):
items = json.load(open('subtitles.json')) items = json.load(open('subtitles.json'))