mirror of
https://github.com/lifegpc/pythonscript.git
synced 2026-06-05 11:08:49 +08:00
支持检测原文与译文时间相同的格式
This commit is contained in:
@@ -76,6 +76,13 @@ class Lyric:
|
||||
re.append({'time': max(ltmp, round(i['time'] - 0.01, 2)),
|
||||
'data': tmp})
|
||||
tmp = None
|
||||
elif i['time'] == ltmp:
|
||||
if tmp is None:
|
||||
tmp = i['data']
|
||||
else:
|
||||
re.append({'time': ltmp, 'data': tmp})
|
||||
tmp = i['data']
|
||||
continue
|
||||
s: str = i['data']
|
||||
if s.find(' / ') > 0:
|
||||
li = s.split(' / ', 1)
|
||||
@@ -83,6 +90,7 @@ class Lyric:
|
||||
tmp = li[1]
|
||||
re.append({'time': i['time'], 'data': li[0]})
|
||||
else:
|
||||
ltmp = i['time']
|
||||
re.append(i.copy())
|
||||
if tmp is not None:
|
||||
if dur is not None:
|
||||
|
||||
Reference in New Issue
Block a user