mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-12 01:36:54 +02:00
Pass Gemini API key in /reels/tts-preview route
The TTS preview route hardcoded the Gemini API key to undefined when calling the ffmpeg service, causing the service to silently fall back to Edge TTS even when the user selected Gemini. Mirror the lookup already used in the reel processing route so the selected engine is honored. https://claude.ai/code/session_01QBvwHAMZzVYfWvy1U5paat
This commit is contained in:
1 file changed
+7
-1
@@ -375,7 +375,13 @@ reelsRouter.post('/reels/tts-preview', async (req: Request, res: Response) => {
|
||||
return res.status(400).json({ error: 'Texte requis' });
|
||||
}
|
||||
|
||||
const result = await ffmpegService.previewTTS(text, ttsVoice, ttsEngine, undefined);
|
||||
let geminiApiKey: string | undefined = undefined;
|
||||
if (ttsEngine === "gemini") {
|
||||
const appCfg = await storage.getAppConfig();
|
||||
geminiApiKey = appCfg?.geminiApiKey ?? undefined;
|
||||
}
|
||||
|
||||
const result = await ffmpegService.previewTTS(text, ttsVoice, ttsEngine, geminiApiKey);
|
||||
|
||||
if (!result.success) {
|
||||
return res.status(500).json({ error: result.error || 'Erreur de génération TTS' });
|
||||
|
||||
Reference in new issue
Block a user