mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-24 07:28:11 +02:00
fix: Improve Reel text generation and add FFmpeg settings - Fix generate-text to use productInfo as ProductInfo object - Add FFmpeg API configuration section in Settings page - Add /api/ffmpeg/config GET/POST routes
This commit is contained in:
1 parent
c2c2fef62f
commit
4903aa5555
3 files changed
+194
-22
No files matched your search
+11
-2
@@ -145,12 +145,21 @@ reelsRouter.post('/reels/generate-text', async (req: Request, res: Response) =>
|
||||
return res.status(400).json({ error: 'Informations produit requises' });
|
||||
}
|
||||
|
||||
const generatedTexts = await openRouterService.generatePostText(productInfo, user.id, model);
|
||||
// Convertir la chaîne de texte simple en objet ProductInfo
|
||||
// Si l'utilisateur envoie une chaîne, on l'utilise comme description du produit
|
||||
const productInfoObject = typeof productInfo === 'string'
|
||||
? {
|
||||
name: productInfo.trim(), // Utiliser le texte comme nom
|
||||
description: productInfo.trim(), // Et comme description
|
||||
}
|
||||
: productInfo;
|
||||
|
||||
const generatedTexts = await openRouterService.generatePostText(productInfoObject, user.id, model);
|
||||
|
||||
// Sauvegarder la génération
|
||||
await storage.createAiGeneration({
|
||||
userId: user.id,
|
||||
productInfo,
|
||||
productInfo: productInfoObject,
|
||||
generatedTexts,
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user