aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/routers
diff options
context:
space:
mode:
authorkamtschatka <simon.schatka@gmx.at>2024-10-28 02:51:00 +0100
committerGitHub <noreply@github.com>2024-10-28 01:51:00 +0000
commit4a13c36da50f6b3171d817edebefe96ba85dc666 (patch)
tree60ff553426493e7ae2460e73c3500a5525ba735c /packages/trpc/routers
parent3b7451f4d0727d597c0af0e602f0c74cf58999af (diff)
downloadkarakeep-4a13c36da50f6b3171d817edebefe96ba85dc666.tar.zst
feature: Archive videos using yt-dlp. Fixes #215 (#525)
* Allow downloading more content from a webpage and index it #215 Added a worker that allows downloading videos depending on the environment variables refactored the code a bit added new video asset updated documentation * Some tweaks * Drop the dependency on the yt-dlp wrapper * Update openapi specs * Dont log an error when the url is not supported * Better handle supported websites that dont download anything --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
Diffstat (limited to 'packages/trpc/routers')
-rw-r--r--packages/trpc/routers/bookmarks.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts
index 80dd4bec..9a27c25a 100644
--- a/packages/trpc/routers/bookmarks.ts
+++ b/packages/trpc/routers/bookmarks.ts
@@ -215,6 +215,8 @@ function toZodSchema(bookmark: BookmarkQueryReturnType): ZBookmark {
imageAssetId: assets.find(
(a) => a.assetType == AssetTypes.LINK_BANNER_IMAGE,
)?.id,
+ videoAssetId: assets.find((a) => a.assetType == AssetTypes.LINK_VIDEO)
+ ?.id,
...link,
};
break;
@@ -698,6 +700,9 @@ export const bookmarksAppRouter = router({
if (row.assets.assetType == AssetTypes.LINK_BANNER_IMAGE) {
content.imageAssetId = row.assets.id;
}
+ if (row.assets.assetType == AssetTypes.LINK_VIDEO) {
+ content.videoAssetId = row.assets.id;
+ }
acc[bookmarkId].content = content;
}
acc[bookmarkId].assets.push({