Skip to content

Commit 136f20b

Browse files
committed
feat: disable bluesky videos, add mastodon character validation
1 parent 807f707 commit 136f20b

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

apps/frontend/src/components/launches/providers/bluesky/bluesky.provider.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
22

33
export default withProvider(null, undefined, undefined, async (posts) => {
4+
if (posts.some((p) => p.some(a => a.path.indexOf('mp4') > -1))) {
5+
return 'At the moment BlueSky does not support video posts.';
6+
}
47
if (posts.some((p) => p.length > 4)) {
58
return 'There can be maximum 4 pictures in a post.';
69
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { FC } from 'react';
22
import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';
3-
export default withProvider(null, undefined, undefined, undefined);
3+
export default withProvider(null, undefined, undefined, undefined, 500);

libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {
66
} from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface';
77
import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
88
import {
9-
NotEnoughScopes, RefreshToken, SocialAbstract
9+
NotEnoughScopes,
10+
RefreshToken,
11+
SocialAbstract,
1012
} from '@gitroom/nestjs-libraries/integrations/social.abstract';
1113
import { BskyAgent, RichText } from '@atproto/api';
1214
import dayjs from 'dayjs';
@@ -165,11 +167,13 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider {
165167
const cidUrl = [] as { cid: string; url: string; rev: string }[];
166168
for (const post of postDetails) {
167169
const images = await Promise.all(
168-
post.media?.map(async (p) => {
169-
return await agent.uploadBlob(
170-
new Blob([await reduceImageBySize(p.url)])
171-
);
172-
}) || []
170+
post.media
171+
?.filter((p) => p.url.indexOf('mp4') === -1)
172+
.map(async (p) => {
173+
return await agent.uploadBlob(
174+
new Blob([await reduceImageBySize(p.url)])
175+
);
176+
}) || []
173177
);
174178

175179
const rt = new RichText({

0 commit comments

Comments
 (0)