import { join } from 'path'
-import { ActorImageModel } from '@server/models/account/actor-image'
+
import { ThumbnailType } from '../../shared/models/videos/thumbnail.type'
import { generateImageFromVideoFile } from '../helpers/ffmpeg-utils'
-import { processImage } from '../helpers/image-utils'
+import { generateImageFilename, processImage } from '../helpers/image-utils'
import { downloadImage } from '../helpers/requests'
import { CONFIG } from '../initializers/config'
import { ASSETS_PATH, PREVIEWS_SIZE, THUMBNAILS_SIZE } from '../initializers/constants'
import { MVideoPlaylistThumbnail } from '../types/models/video/video-playlist'
import { getVideoFilePath } from './video-paths'
-type ImageSize = { height: number, width: number }
+type ImageSize = { height?: number, width?: number }
function createPlaylistMiniatureFromExisting (options: {
inputPath: string
: undefined
if (type === ThumbnailType.MINIATURE) {
- const filename = ActorImageModel.generateFilename()
+ const filename = generateImageFilename()
const basePath = CONFIG.STORAGE.THUMBNAILS_DIR
return {
}
if (type === ThumbnailType.PREVIEW) {
- const filename = ActorImageModel.generateFilename()
+ const filename = generateImageFilename()
const basePath = CONFIG.STORAGE.PREVIEWS_DIR
return {