Skip to content

Commit

Permalink
Fixed some rows not having timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmozhijin committed Mar 6, 2024
1 parent a72f0ab commit 4dce741
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils/lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,9 @@ def get_full_line(mapping_table: dict, orig_linelist: list) -> str:
if not has_content(line_str):
return ""
if orig_linelist[0] is not None:
if re.search(end_time_pattern, line_str): # 检查是否有结束时间
if re.search(end_time_pattern, line_str) or orig_linelist[1] is None: # 检查是否有结束时间
return f"[{ms2formattime(orig_linelist[0])}]{line_str}"
if orig_linelist[1]:
return f"[{ms2formattime(orig_linelist[0])}]{line_str}[{ms2formattime(orig_linelist[1])}]"
return f"[{ms2formattime(orig_linelist[0])}]{line_str}[{ms2formattime(orig_linelist[1])}]"
return line_str

for orig_linelist in self["orig"]:
Expand Down

0 comments on commit 4dce741

Please sign in to comment.