mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-16 19:59:42 +02:00
Add GEMINI_API_KEY env var fallback for TTS
Add GEMINI_API_KEY to docker-compose so it can be set in Portainer. Fall back to this env var when the DB app_config has no geminiApiKey, so Gemini TTS works without requiring the user to save the key through the Settings UI. https://claude.ai/code/session_01QBvwHAMZzVYfWvy1U5paat
This commit is contained in:
2 files changed
+4
-3
No files matched your search
@@ -324,7 +324,7 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => {
|
||||
let geminiApiKey: string | undefined = undefined;
|
||||
if (ttsEngine === "gemini") {
|
||||
const appCfg = await storage.getAppConfig();
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? undefined;
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? process.env.GEMINI_API_KEY ?? undefined;
|
||||
}
|
||||
|
||||
const finalWordDuration = wordDuration;
|
||||
@@ -378,7 +378,7 @@ reelsRouter.post('/reels/tts-preview', async (req: Request, res: Response) => {
|
||||
let geminiApiKey: string | undefined = undefined;
|
||||
if (ttsEngine === "gemini") {
|
||||
const appCfg = await storage.getAppConfig();
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? undefined;
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? process.env.GEMINI_API_KEY ?? undefined;
|
||||
}
|
||||
|
||||
const result = await ffmpegService.previewTTS(text, ttsVoice, ttsEngine, geminiApiKey);
|
||||
@@ -566,7 +566,7 @@ async function processReelBackground(
|
||||
let geminiApiKey: string | undefined = undefined;
|
||||
if (ttsEngine === "gemini") {
|
||||
const appCfg = await storage.getAppConfig();
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? undefined;
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? process.env.GEMINI_API_KEY ?? undefined;
|
||||
}
|
||||
|
||||
const finalWordDuration = wordDuration ?? 0.6;
|
||||
|
||||
Reference in new issue
Block a user