From 68e27adb029cb7bb7b51b8ea594163931a495c61 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 2 Feb 2025 15:44:48 +0000 Subject: fix: Dont rearchive singlefile uploads and consider them as archives --- packages/trpc/routers/bookmarks.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/trpc') diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 817ceef3..12ec9ccb 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -234,6 +234,9 @@ function toZodSchema(bookmark: BookmarkQueryReturnType): ZBookmark { fullPageArchiveAssetId: assets.find( (a) => a.assetType == AssetTypes.LINK_FULL_PAGE_ARCHIVE, )?.id, + precrawledArchiveAssetId: assets.find( + (a) => a.assetType == AssetTypes.LINK_PRECRAWLED_ARCHIVE, + )?.id, imageAssetId: assets.find( (a) => a.assetType == AssetTypes.LINK_BANNER_IMAGE, )?.id, @@ -873,6 +876,9 @@ export const bookmarksAppRouter = router({ if (row.assets.assetType == AssetTypes.LINK_VIDEO) { content.videoAssetId = row.assets.id; } + if (row.assets.assetType == AssetTypes.LINK_PRECRAWLED_ARCHIVE) { + content.precrawledArchiveAssetId = row.assets.id; + } acc[bookmarkId].content = content; } acc[bookmarkId].assets.push({ -- cgit v1.2.3-70-g09d2