feat: add API routes for Jamendo music search, popular tracks, user favorites, and track details, including a placeholder for AI text generation for Reels.

This commit is contained in:
Michael committed 2026-03-02 13:49:08 +01:00
1 parent 40a057e924
commit 6d16dc9d41
1 file changed
+9 -2
+9 -2
View File
@@ -321,7 +321,11 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => {
const internalId = musicTrackId.replace('internal_', '');
const track = await storage.getAudioTrack(internalId);
if (track) {
finalMusicUrl = track.url;
// track.url est relatif (/uploads/audio/...) → on le rend absolu pour le service ffmpeg
const appUrl = process.env.APP_URL || 'http://localhost:5555';
finalMusicUrl = track.url.startsWith('http')
? track.url
: `${appUrl}${track.url}`;
}
} else {
const track = await freeSoundService.getMusicDetails(musicTrackId);
@@ -509,7 +513,10 @@ async function processReelBackground(
const internalId = musicTrackId.replace('internal_', '');
const track = await storage.getAudioTrack(internalId);
if (track) {
finalMusicUrl = track.url;
const appUrl = process.env.APP_URL || 'http://localhost:5555';
finalMusicUrl = track.url.startsWith('http')
? track.url
: `${appUrl}${track.url}`;
}
} catch (e) { console.error('Error fetching internal track', e); }
} else {