feat: disable bluesky videos, add mastodon character validation

This commit is contained in:
Nevo David 2025-02-06 12:46:04 +07:00
parent 807f7078f3
commit 136f20b7ed
3 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,9 @@
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
export default withProvider(null, undefined, undefined, async (posts) => {
if (posts.some((p) => p.some(a => a.path.indexOf('mp4') > -1))) {
return 'At the moment BlueSky does not support video posts.';
}
if (posts.some((p) => p.length > 4)) {
return 'There can be maximum 4 pictures in a post.';
}

View File

@ -1,3 +1,3 @@
import { FC } from 'react';
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
export default withProvider(null, undefined, undefined, undefined);
export default withProvider(null, undefined, undefined, undefined, 500);

View File

@ -6,7 +6,9 @@ import {
} from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface';
import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
import {
NotEnoughScopes, RefreshToken, SocialAbstract
NotEnoughScopes,
RefreshToken,
SocialAbstract,
} from '@gitroom/nestjs-libraries/integrations/social.abstract';
import { BskyAgent, RichText } from '@atproto/api';
import dayjs from 'dayjs';
@ -165,11 +167,13 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider {
const cidUrl = [] as { cid: string; url: string; rev: string }[];
for (const post of postDetails) {
const images = await Promise.all(
post.media?.map(async (p) => {
return await agent.uploadBlob(
new Blob([await reduceImageBySize(p.url)])
);
}) || []
post.media
?.filter((p) => p.url.indexOf('mp4') === -1)
.map(async (p) => {
return await agent.uploadBlob(
new Blob([await reduceImageBySize(p.url)])
);
}) || []
);
const rt = new RichText({