From 23569eb60d94f3f1b3d1a40701e5a5ff68a5478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E5=B0=8F=E9=B8=AD?= Date: Wed, 4 Jun 2025 22:59:04 +0800 Subject: [PATCH 1/2] add config.yaml.example --- .gitignore | 3 ++- config.yaml => config.yaml.example | 0 install.py | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) rename config.yaml => config.yaml.example (100%) diff --git a/.gitignore b/.gitignore index ca46faeb..16d8680a 100644 --- a/.gitignore +++ b/.gitignore @@ -171,4 +171,5 @@ config.backup.yaml # runtime runtime/ dev/ -installer_files/ \ No newline at end of file +installer_files/ +config.yaml diff --git a/config.yaml b/config.yaml.example similarity index 100% rename from config.yaml rename to config.yaml.example diff --git a/install.py b/install.py index 697f1752..2bb6b636 100644 --- a/install.py +++ b/install.py @@ -1,6 +1,7 @@ import os, sys import platform import subprocess +import shutil sys.path.append(os.path.dirname(os.path.abspath(__file__))) ascii_logo = """ @@ -87,6 +88,10 @@ def main(): from core.utils.decorator import except_handler console = Console() + + # copy defaule config.yaml to config.yaml + if not os.path.exists("config.yaml"): + shutil.copy("config.yaml.example", "config.yaml") width = max(len(line) for line in ascii_logo.splitlines()) + 4 welcome_panel = Panel( From 0ac0face1671df26122d0b530f2247b8e2fceac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E5=B0=8F=E9=B8=AD?= Date: Mon, 9 Jun 2025 00:31:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bugfix=EF=BC=9A=E5=8F=8C=E8=AF=AD=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=8E=9F=E5=8F=A5?= =?UTF-8?q?=E5=92=8C=E7=BF=BB=E8=AF=91=E5=8F=A5=E5=8F=AF=E8=83=BD=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E4=B8=8D=E5=90=8C=E5=AF=BC=E8=87=B4=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E8=A2=AB=E5=88=86=E5=8F=A5=E4=B8=80=E4=B8=AA=E6=B2=A1=E6=9C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/_5_split_sub.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/_5_split_sub.py b/core/_5_split_sub.py index 76669646..c2252b76 100644 --- a/core/_5_split_sub.py +++ b/core/_5_split_sub.py @@ -43,6 +43,11 @@ def valid_align(response_data): align_data = parsed['align'] src_parts = src_part.split('\n') tr_parts = [item[f'target_part_{i+1}'].strip() for i, item in enumerate(align_data)] + + # bugfix: if the src_parts and tr_parts have different lengths, merge them into one part + if len(src_parts) != len(tr_parts): + src_parts = ["\n".join(src_parts)] + tr_parts = ["\n".join(tr_parts)] whisper_language = load_key("whisper.language") language = load_key("whisper.detected_language") if whisper_language == 'auto' else whisper_language