- const input = getVideoFilePath(video, videoFile)
-
- const { filename, basePath, height, width, existingThumbnail, outputPath } = buildMetadataFromVideo(video, type)
- const thumbnailCreator = videoFile.isAudio()
- ? () => processImage(ASSETS_PATH.DEFAULT_AUDIO_BACKGROUND, outputPath, { width, height }, true)
- : () => generateImageFromVideoFile(input, basePath, filename, { height, width })
-
- return createThumbnailFromFunction({
- thumbnailCreator,
- filename,
- height,
- width,
- type,
- automaticallyGenerated: true,
- existingThumbnail
+ return VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), input => {
+ const { filename, basePath, height, width, existingThumbnail, outputPath } = buildMetadataFromVideo(video, type)
+
+ const thumbnailCreator = videoFile.isAudio()
+ ? () => processImageFromWorker({
+ path: ASSETS_PATH.DEFAULT_AUDIO_BACKGROUND,
+ destination: outputPath,
+ newSize: { width, height },
+ keepOriginal: true
+ })
+ : () => generateImageFromVideoFile({
+ fromPath: input,
+ folder: basePath,
+ imageName: filename,
+ size: { height, width }
+ })
+
+ return updateThumbnailFromFunction({
+ thumbnailCreator,
+ filename,
+ height,
+ width,
+ type,
+ automaticallyGenerated: true,
+ existingThumbnail
+ })