From d23a7d56c013cde1aec2be78dddf6cca3bfab75e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 27 Mar 2024 13:54:54 +0800 Subject: [PATCH] Only check for summaries if the updated entity is a page item --- packages/api/src/pubsub.ts | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/api/src/pubsub.ts b/packages/api/src/pubsub.ts index c64b45900..237a5801f 100644 --- a/packages/api/src/pubsub.ts +++ b/packages/api/src/pubsub.ts @@ -86,22 +86,24 @@ export const createPubSubClient = (): PubsubClient => { data, }) - if (await findFeatureByName(FeatureName.AISummaries, userId)) { - // await enqueueAISummarizeJob({ - // userId, - // libraryItemId, - // }) - } + if (type === EntityType.PAGE) { + if (await findFeatureByName(FeatureName.AISummaries, userId)) { + // await enqueueAISummarizeJob({ + // userId, + // libraryItemId, + // }) + } - const isYoutubeVideo = (data: any): data is { originalUrl: string } => { - return 'originalUrl' in data - } + const isYoutubeVideo = (data: any): data is { originalUrl: string } => { + return 'originalUrl' in data + } - if (isYoutubeVideo(data) && isYouTubeVideoURL(data['originalUrl'])) { - await enqueueProcessYouTubeVideo({ - userId, - libraryItemId, - }) + if (isYoutubeVideo(data) && isYouTubeVideoURL(data['originalUrl'])) { + await enqueueProcessYouTubeVideo({ + userId, + libraryItemId, + }) + } } }, entityUpdated: async >(