This commit is contained in:
949036910@qq.com
2026-06-02 21:52:12 +08:00
parent d637088a34
commit a2c01f306f
6 changed files with 291 additions and 31 deletions

View File

@@ -31,7 +31,7 @@ function normalizePathForPython(filePath) {
}
function buildPythonEnv() {
const env = { ...process.env, PYTHONIOENCODING: "utf-8" };
const env = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
const ffmpeg = pipelineNative.locateFfmpeg();
if (ffmpeg && fs.existsSync(ffmpeg)) {
const ffmpegDir = path.dirname(ffmpeg);
@@ -39,6 +39,16 @@ function buildPythonEnv() {
env.PATH = `${ffmpegDir}${sep}${env.PATH || ""}`;
env.AICLIENT_FFMPEG_PATH = ffmpeg;
}
const scriptsDir = locateCoverScriptsDir();
console.log("scriptsDir", scriptsDir);
if (scriptsDir) {
env.AICLIENT_COVER_SCRIPTS_DIR = scriptsDir;
env.APP_ROOT = path.dirname(scriptsDir);
const fontsDir = path.join(scriptsDir, "fonts");
if (fs.existsSync(fontsDir)) {
env.AICLIENT_COVER_FONTS_DIR = fontsDir;
}
}
return env;
}