diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-08 11:23:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-08 13:38:04 +0200 |
commit | 84531547bc0934a2abda586d539f7455b455d488 (patch) | |
tree | 128bf5f3a7f57e4e2f343d5da574a4e002163736 /server/lib/thumbnail.ts | |
parent | a0eeb45f14bab539f505861cad8f5d42d9ba30cb (diff) | |
download | PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.gz PeerTube-84531547bc0934a2abda586d539f7455b455d488.tar.zst PeerTube-84531547bc0934a2abda586d539f7455b455d488.zip |
Add size info in db for actor images
Diffstat (limited to 'server/lib/thumbnail.ts')
-rw-r--r-- | server/lib/thumbnail.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/thumbnail.ts b/server/lib/thumbnail.ts index e1176ac08..cfee69cfc 100644 --- a/server/lib/thumbnail.ts +++ b/server/lib/thumbnail.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { ActorImageModel } from '@server/models/account/actor-image' | 2 | |
3 | import { ThumbnailType } from '../../shared/models/videos/thumbnail.type' | 3 | import { ThumbnailType } from '../../shared/models/videos/thumbnail.type' |
4 | import { generateImageFromVideoFile } from '../helpers/ffmpeg-utils' | 4 | import { generateImageFromVideoFile } from '../helpers/ffmpeg-utils' |
5 | import { processImage } from '../helpers/image-utils' | 5 | import { generateImageFilename, processImage } from '../helpers/image-utils' |
6 | import { downloadImage } from '../helpers/requests' | 6 | import { downloadImage } from '../helpers/requests' |
7 | import { CONFIG } from '../initializers/config' | 7 | import { CONFIG } from '../initializers/config' |
8 | import { ASSETS_PATH, PREVIEWS_SIZE, THUMBNAILS_SIZE } from '../initializers/constants' | 8 | import { ASSETS_PATH, PREVIEWS_SIZE, THUMBNAILS_SIZE } from '../initializers/constants' |
@@ -12,7 +12,7 @@ import { MThumbnail } from '../types/models/video/thumbnail' | |||
12 | import { MVideoPlaylistThumbnail } from '../types/models/video/video-playlist' | 12 | import { MVideoPlaylistThumbnail } from '../types/models/video/video-playlist' |
13 | import { getVideoFilePath } from './video-paths' | 13 | import { getVideoFilePath } from './video-paths' |
14 | 14 | ||
15 | type ImageSize = { height: number, width: number } | 15 | type ImageSize = { height?: number, width?: number } |
16 | 16 | ||
17 | function createPlaylistMiniatureFromExisting (options: { | 17 | function createPlaylistMiniatureFromExisting (options: { |
18 | inputPath: string | 18 | inputPath: string |
@@ -201,7 +201,7 @@ function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType, si | |||
201 | : undefined | 201 | : undefined |
202 | 202 | ||
203 | if (type === ThumbnailType.MINIATURE) { | 203 | if (type === ThumbnailType.MINIATURE) { |
204 | const filename = ActorImageModel.generateFilename() | 204 | const filename = generateImageFilename() |
205 | const basePath = CONFIG.STORAGE.THUMBNAILS_DIR | 205 | const basePath = CONFIG.STORAGE.THUMBNAILS_DIR |
206 | 206 | ||
207 | return { | 207 | return { |
@@ -215,7 +215,7 @@ function buildMetadataFromVideo (video: MVideoThumbnail, type: ThumbnailType, si | |||
215 | } | 215 | } |
216 | 216 | ||
217 | if (type === ThumbnailType.PREVIEW) { | 217 | if (type === ThumbnailType.PREVIEW) { |
218 | const filename = ActorImageModel.generateFilename() | 218 | const filename = generateImageFilename() |
219 | const basePath = CONFIG.STORAGE.PREVIEWS_DIR | 219 | const basePath = CONFIG.STORAGE.PREVIEWS_DIR |
220 | 220 | ||
221 | return { | 221 | return { |