const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromPlaylist(playlist, size)
const type = ThumbnailType.MINIATURE
- const thumbnailCreator = () => processImage({ path: inputPath }, outputPath, { width, height }, keepOriginal)
+ const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height }, keepOriginal)
return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail })
}
-function createPlaylistMiniatureFromUrl (url: string, playlist: VideoPlaylistModel, size?: ImageSize) {
+function createPlaylistMiniatureFromUrl (fileUrl: string, playlist: VideoPlaylistModel, size?: ImageSize) {
const { filename, basePath, height, width, existingThumbnail } = buildMetadataFromPlaylist(playlist, size)
const type = ThumbnailType.MINIATURE
- const thumbnailCreator = () => downloadImage(url, basePath, filename, { width, height })
- return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, url })
+ const thumbnailCreator = () => downloadImage(fileUrl, basePath, filename, { width, height })
+ return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, fileUrl })
}
-function createVideoMiniatureFromUrl (url: string, video: VideoModel, type: ThumbnailType, size?: ImageSize) {
+function createVideoMiniatureFromUrl (fileUrl: string, video: VideoModel, type: ThumbnailType, size?: ImageSize) {
const { filename, basePath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size)
- const thumbnailCreator = () => downloadImage(url, basePath, filename, { width, height })
+ const thumbnailCreator = () => downloadImage(fileUrl, basePath, filename, { width, height })
- return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, url })
+ return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail, fileUrl })
}
function createVideoMiniatureFromExisting (inputPath: string, video: VideoModel, type: ThumbnailType, size?: ImageSize) {
const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size)
- const thumbnailCreator = () => processImage({ path: inputPath }, outputPath, { width, height })
+ const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height })
return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail })
}
return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail })
}
-function createPlaceholderThumbnail (url: string, video: VideoModel, type: ThumbnailType, size: ImageSize) {
+function createPlaceholderThumbnail (fileUrl: string, video: VideoModel, type: ThumbnailType, size: ImageSize) {
const { filename, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size)
const thumbnail = existingThumbnail ? existingThumbnail : new ThumbnailModel()
thumbnail.height = height
thumbnail.width = width
thumbnail.type = type
- thumbnail.url = url
+ thumbnail.fileUrl = fileUrl
return thumbnail
}
height: number,
width: number,
type: ThumbnailType,
- url?: string,
+ fileUrl?: string,
existingThumbnail?: ThumbnailModel
}) {
- const { thumbnailCreator, filename, width, height, type, existingThumbnail, url = null } = parameters
+ const { thumbnailCreator, filename, width, height, type, existingThumbnail, fileUrl = null } = parameters
const thumbnail = existingThumbnail ? existingThumbnail : new ThumbnailModel()
thumbnail.height = height
thumbnail.width = width
thumbnail.type = type
- thumbnail.url = url
+ thumbnail.fileUrl = fileUrl
await thumbnailCreator()