fix: ensure persistence of video data for scheduled reels and correct publication type

This commit is contained in:
Michael committed 2026-01-29 11:58:29 +01:00
1 parent d62ecffaac
commit c9f7f7e9ec
2 files changed
+29 -1

No files matched your search

+12
View File
@@ -59,6 +59,18 @@ export class FacebookService {
// Return all story IDs joined together
return storyIds.join(',');
} else if (postType === 'reel') {
// Publish as Reel
if (mediaList.length === 0) {
throw new Error('Reels require a video');
}
const videoMedia = mediaList.find(m => m.type === 'video');
if (!videoMedia) {
throw new Error('Reels require a video media');
}
return await this.publishReel(page, videoMedia.originalUrl, post.content);
} else {
// Default to feed
const imageMedia = mediaList.filter(m => m.type === 'image');