Skip to content

Commit

Permalink
Merge pull request #260 from harry0703/dev
Browse files Browse the repository at this point in the history
optimize subtitle segmentation and code
  • Loading branch information
harry0703 authored Apr 15, 2024
2 parents 3de3e19 + bd33419 commit b836934
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ def save_config():
ffmpeg_path = app.get("ffmpeg_path", "")
if ffmpeg_path and os.path.isfile(ffmpeg_path):
os.environ["IMAGEIO_FFMPEG_EXE"] = ffmpeg_path

logger.info(f"{project_name} v{project_version}")
7 changes: 7 additions & 0 deletions app/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ def split_string_by_punctuations(s):
next_char = ""
for i in range(len(s)):
char = s[i]
if char == "\n":
result.append(txt.strip())
txt = ""
continue

if i > 0:
previous_char = s[i - 1]
if i < len(s) - 1:
Expand All @@ -184,6 +189,8 @@ def split_string_by_punctuations(s):
result.append(txt.strip())
txt = ""

# filter empty string
result = list(filter(None, result))
return result


Expand Down
1 change: 1 addition & 0 deletions webui/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get_all_fonts():
for file in files:
if file.endswith(".ttf") or file.endswith(".ttc"):
fonts.append(file)
fonts.sort()
return fonts


Expand Down

0 comments on commit b836934

Please sign in to comment.