Update Facebook posting to use original media URLs

Modify FacebookService to utilize `media.originalUrl` instead of specific optimized URLs for photo posts, carousel posts, and stories, allowing Facebook to handle cropping and formatting.

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/8Nctbk0
This commit is contained in:
michaelschal committed 2025-10-09 11:31:21 +00:00
1 parent 23472751ac
commit 4e32e97fe4
1 file changed
+8 -6
+8 -6
View File
@@ -88,8 +88,8 @@ export class FacebookService {
}
private async publishPhotoPost(post: Post, page: SocialPage, media: Media): Promise<string> {
// Use the Facebook Feed optimized URL (1200x630)
const photoUrl = media.facebookFeedUrl || media.originalUrl;
// Use original URL - Facebook handles the cropping
const photoUrl = media.originalUrl;
const params = new URLSearchParams({
access_token: page.accessToken!,
@@ -128,7 +128,8 @@ export class FacebookService {
const photoIds: string[] = [];
for (const media of imageMedia) {
const photoUrl = media.facebookFeedUrl || media.originalUrl;
// Use original URL - Facebook handles the cropping for carousel
const photoUrl = media.originalUrl;
if (!photoUrl) {
console.warn(`Skipping media ${media.id} - no valid URL found`);
@@ -242,7 +243,8 @@ export class FacebookService {
}
private async schedulePhotoPost(post: Post, page: SocialPage, scheduledTimestamp: number, media: Media): Promise<string> {
const photoUrl = media.facebookFeedUrl || media.originalUrl;
// Use original URL - Facebook handles the cropping
const photoUrl = media.originalUrl;
const params = new URLSearchParams({
access_token: page.accessToken!,
@@ -268,8 +270,8 @@ export class FacebookService {
}
private async publishStory(post: Post, page: SocialPage, media: Media): Promise<string> {
// Use vertical format for stories (Instagram Story URL 1080x1920)
const photoUrl = media.instagramStoryUrl || media.originalUrl;
// Use original URL - Facebook handles the story cropping
const photoUrl = media.originalUrl;
const params = new URLSearchParams({
access_token: page.accessToken!,