aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue
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/job-queue
parenta673d9e848e51186602548a621e05925663b98be (diff)
downloadPeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.gz
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.tar.zst
PeerTube-f162d32da098aa55f6de2367142faa166edb7c08.zip
Support lazy download thumbnails
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts4
-rw-r--r--server/lib/job-queue/handlers/video-live-ending.ts8
2 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index c1355dcef..436bf3175 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -39,7 +39,7 @@ import { VideoFileModel } from '../../../models/video/video-file'
39import { VideoImportModel } from '../../../models/video/video-import' 39import { VideoImportModel } from '../../../models/video/video-import'
40import { federateVideoIfNeeded } from '../../activitypub/videos' 40import { federateVideoIfNeeded } from '../../activitypub/videos'
41import { Notifier } from '../../notifier' 41import { Notifier } from '../../notifier'
42import { generateVideoMiniature } from '../../thumbnail' 42import { generateLocalVideoMiniature } from '../../thumbnail'
43import { JobQueue } from '../job-queue' 43import { JobQueue } from '../job-queue'
44 44
45async function processVideoImport (job: Job): Promise<VideoImportPreventExceptionResult> { 45async function processVideoImport (job: Job): Promise<VideoImportPreventExceptionResult> {
@@ -274,7 +274,7 @@ async function generateMiniature (videoImportWithFiles: MVideoImportDefaultFiles
274 } 274 }
275 } 275 }
276 276
277 const miniatureModel = await generateVideoMiniature({ 277 const miniatureModel = await generateLocalVideoMiniature({
278 video: videoImportWithFiles.Video, 278 video: videoImportWithFiles.Video,
279 videoFile, 279 videoFile,
280 type: thumbnailType 280 type: thumbnailType
diff --git a/server/lib/job-queue/handlers/video-live-ending.ts b/server/lib/job-queue/handlers/video-live-ending.ts
index 95d4f5e64..ae886de35 100644
--- a/server/lib/job-queue/handlers/video-live-ending.ts
+++ b/server/lib/job-queue/handlers/video-live-ending.ts
@@ -7,7 +7,7 @@ import { getLocalVideoActivityPubUrl } from '@server/lib/activitypub/url'
7import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 7import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
8import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live' 8import { cleanupAndDestroyPermanentLive, cleanupTMPLiveFiles, cleanupUnsavedNormalLive } from '@server/lib/live'
9import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths' 9import { generateHLSMasterPlaylistFilename, generateHlsSha256SegmentsFilename, getLiveReplayBaseDirectory } from '@server/lib/paths'
10import { generateVideoMiniature } from '@server/lib/thumbnail' 10import { generateLocalVideoMiniature } from '@server/lib/thumbnail'
11import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding' 11import { generateHlsPlaylistResolutionFromTS } from '@server/lib/transcoding/hls-transcoding'
12import { VideoPathManager } from '@server/lib/video-path-manager' 12import { VideoPathManager } from '@server/lib/video-path-manager'
13import { moveToNextState } from '@server/lib/video-state' 13import { moveToNextState } from '@server/lib/video-state'
@@ -143,7 +143,7 @@ async function saveReplayToExternalVideo (options: {
143 await remove(replayDirectory) 143 await remove(replayDirectory)
144 144
145 for (const type of [ ThumbnailType.MINIATURE, ThumbnailType.PREVIEW ]) { 145 for (const type of [ ThumbnailType.MINIATURE, ThumbnailType.PREVIEW ]) {
146 const image = await generateVideoMiniature({ video: replayVideo, videoFile: replayVideo.getMaxQualityFile(), type }) 146 const image = await generateLocalVideoMiniature({ video: replayVideo, videoFile: replayVideo.getMaxQualityFile(), type })
147 await replayVideo.addAndSaveThumbnail(image) 147 await replayVideo.addAndSaveThumbnail(image)
148 } 148 }
149 149
@@ -198,7 +198,7 @@ async function replaceLiveByReplay (options: {
198 198
199 // Regenerate the thumbnail & preview? 199 // Regenerate the thumbnail & preview?
200 if (videoWithFiles.getMiniature().automaticallyGenerated === true) { 200 if (videoWithFiles.getMiniature().automaticallyGenerated === true) {
201 const miniature = await generateVideoMiniature({ 201 const miniature = await generateLocalVideoMiniature({
202 video: videoWithFiles, 202 video: videoWithFiles,
203 videoFile: videoWithFiles.getMaxQualityFile(), 203 videoFile: videoWithFiles.getMaxQualityFile(),
204 type: ThumbnailType.MINIATURE 204 type: ThumbnailType.MINIATURE
@@ -207,7 +207,7 @@ async function replaceLiveByReplay (options: {
207 } 207 }
208 208
209 if (videoWithFiles.getPreview().automaticallyGenerated === true) { 209 if (videoWithFiles.getPreview().automaticallyGenerated === true) {
210 const preview = await generateVideoMiniature({ 210 const preview = await generateLocalVideoMiniature({
211 video: videoWithFiles, 211 video: videoWithFiles,
212 videoFile: videoWithFiles.getMaxQualityFile(), 212 videoFile: videoWithFiles.getMaxQualityFile(),
213 type: ThumbnailType.PREVIEW 213 type: ThumbnailType.PREVIEW