Enable sending multiple photos as individual stories on Facebook

Update FacebookService to publish each media item in mediaList as a separate story, returning a comma-separated string of story IDs.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/mIWJXC9
This commit is contained in:
michaelschal committed 2025-10-13 05:32:33 +00:00
1 parent 5c54f2abb1
commit 5c591899a1
1 file changed
+11 -2
+11 -2
View File
@@ -38,11 +38,20 @@ export class FacebookService {
}
if (postType === 'story') {
// Publish as story only
// Publish as story - one story per media
if (mediaList.length === 0) {
throw new Error('Stories require media (photo or video)');
}
return await this.publishStory(post, page, mediaList[0]);
// Publish each media as a separate story
const storyIds: string[] = [];
for (const media of mediaList) {
const storyId = await this.publishStory(post, page, media);
storyIds.push(storyId);
}
// Return all story IDs joined together
return storyIds.join(',');
} else {
// Default to feed
// Count images only (videos not supported in multi-photo carousel)