rounding issues
This commit is contained in:
parent
856129d471
commit
e25fb42d2d
1 changed files with 5 additions and 4 deletions
|
@ -180,10 +180,10 @@ def render_subtitles(item_json, output_json, output_srt, lang):
|
|||
|
||||
|
||||
def overlaps(src, other):
|
||||
src_in = float('%0.3f' % src['in'])
|
||||
src_out = float('%0.3f' % src['out'])
|
||||
other_in = float('%0.3f' % other['in'])
|
||||
other_out = float('%0.3f' % other['out'])
|
||||
src_in = float('%0.2f' % src['in'])
|
||||
src_out = float('%0.2f' % src['out'])
|
||||
other_in = float('%0.2f' % other['in'])
|
||||
other_out = float('%0.2f' % other['out'])
|
||||
points = []
|
||||
if src_in != other_in or src_out != other_out:
|
||||
# src inside
|
||||
|
@ -193,6 +193,7 @@ def overlaps(src, other):
|
|||
points += [other['out']]
|
||||
return points
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if os.path.exists('subtitles.json'):
|
||||
items = json.load(open('subtitles.json'))
|
||||
|
|
Loading…
Reference in a new issue