aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-06 15:59:51 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 10:19:33 +0200
commitf162d32da098aa55f6de2367142faa166edb7c08 (patch)
tree31c6a96972994171853cb6c4e0b88b63241f8979 /server/lib/activitypub/videos
parenta673d9e848e51186602548a621e05925663b98be (diff)
downloadPeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.gz
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.zst
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.zip
Support lazy download thumbnails
Diffstat (limited to 'server/lib/activitypub/videos')
-rw-r--r--server/lib/activitypub/videos/shared/abstract-builder.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/activitypub/videos/shared/abstract-builder.ts b/server/lib/activitypub/videos/shared/abstract-builder.ts
index 8af67ecac..e50bf29dc 100644
--- a/server/lib/activitypub/videos/shared/abstract-builder.ts
+++ b/server/lib/activitypub/videos/shared/abstract-builder.ts
@@ -1,7 +1,7 @@
1import { CreationAttributes, Transaction } from 'sequelize/types' 1import { CreationAttributes, Transaction } from 'sequelize/types'
2import { deleteAllModels, filterNonExistingModels } from '@server/helpers/database-utils' 2import { deleteAllModels, filterNonExistingModels } from '@server/helpers/database-utils'
3import { logger, LoggerTagsFn } from '@server/helpers/logger' 3import { logger, LoggerTagsFn } from '@server/helpers/logger'
4import { updatePlaceholderThumbnail, updateVideoMiniatureFromUrl } from '@server/lib/thumbnail' 4import { updateRemoteThumbnail, updateVideoMiniatureFromUrl } from '@server/lib/thumbnail'
5import { setVideoTags } from '@server/lib/video' 5import { setVideoTags } from '@server/lib/video'
6import { StoryboardModel } from '@server/models/video/storyboard' 6import { StoryboardModel } from '@server/models/video/storyboard'
7import { VideoCaptionModel } from '@server/models/video/video-caption' 7import { VideoCaptionModel } from '@server/models/video/video-caption'
@@ -55,15 +55,15 @@ export abstract class APVideoAbstractBuilder {
55 } 55 }
56 56
57 protected async setPreview (video: MVideoFullLight, t?: Transaction) { 57 protected async setPreview (video: MVideoFullLight, t?: Transaction) {
58 // Don't fetch the preview that could be big, create a placeholder instead
59 const previewIcon = getPreviewFromIcons(this.videoObject) 58 const previewIcon = getPreviewFromIcons(this.videoObject)
60 if (!previewIcon) return 59 if (!previewIcon) return
61 60
62 const previewModel = updatePlaceholderThumbnail({ 61 const previewModel = updateRemoteThumbnail({
63 fileUrl: previewIcon.url, 62 fileUrl: previewIcon.url,
64 video, 63 video,
65 type: ThumbnailType.PREVIEW, 64 type: ThumbnailType.PREVIEW,
66 size: previewIcon 65 size: previewIcon,
66 onDisk: false // Don't fetch the preview that could be big, create a placeholder instead
67 }) 67 })
68 68
69 await video.addAndSaveThumbnail(previewModel, t) 69 await video.addAndSaveThumbnail(previewModel, t)