1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Update data in DB when regenerate thumbnails

This commit is contained in:
Chocobozzz 2021-04-08 10:35:49 +02:00
parent ca87329289
commit a0eeb45f14
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 52 additions and 27 deletions

View file

@ -1,4 +1,5 @@
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'
@ -200,7 +201,7 @@ function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType, si
: undefined
if (type === ThumbnailType.MINIATURE) {
const filename = video.generateThumbnailName()
const filename = ActorImageModel.generateFilename()
const basePath = CONFIG.STORAGE.THUMBNAILS_DIR
return {
@ -214,7 +215,7 @@ function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType, si
}
if (type === ThumbnailType.PREVIEW) {
const filename = video.generatePreviewName()
const filename = ActorImageModel.generateFilename()
const basePath = CONFIG.STORAGE.PREVIEWS_DIR
return {