feat: 优化学习视频转写与字幕清洗

This commit is contained in:
2026-09-11 14:26:02 +08:00
parent a8fe133aa4
commit eba9163246
12 changed files with 552 additions and 28 deletions
+4 -1
View File
@@ -218,7 +218,10 @@ def list_batch_roots() -> list[dict]:
roots.append({"path": str(drive), "name": f"{letter}:\\"})
else:
roots.append({"path": "/", "name": "/"})
home = Path.home()
# 用环境变量解析家目录,避免测试模拟 Windows 分支时在 POSIX 进程中
# 调用 Path.home() 触发 WindowsPath 的平台不匹配异常。
home_value = os.environ.get("USERPROFILE") or os.environ.get("HOME")
home = Path(home_value).expanduser() if home_value else Path.home()
roots.append({"path": str(home), "name": f"家目录({home.name}"})
return roots