diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-04 09:19:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-04 15:45:44 +0200 |
commit | 91f8f8db97ffb83701c30f9cdb1e804670434eb0 (patch) | |
tree | 4b6659c8572d95b78454c6c4806ddc77a9c420e1 /server/controllers/api/videos | |
parent | 1333ab1f2d4ec495084c5368df25610683582ae3 (diff) | |
download | PeerTube-91f8f8db97ffb83701c30f9cdb1e804670434eb0.tar.gz PeerTube-91f8f8db97ffb83701c30f9cdb1e804670434eb0.tar.zst PeerTube-91f8f8db97ffb83701c30f9cdb1e804670434eb0.zip |
createThumbnail -> updateThumbnail
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/import.ts | 10 | ||||
-rw-r--r-- | server/controllers/api/videos/live.ts | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 42ca59975..de9a5308a 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -31,7 +31,7 @@ import { MIMETYPES } from '../../../initializers/constants' | |||
31 | import { sequelizeTypescript } from '../../../initializers/database' | 31 | import { sequelizeTypescript } from '../../../initializers/database' |
32 | import { getLocalVideoActivityPubUrl } from '../../../lib/activitypub/url' | 32 | import { getLocalVideoActivityPubUrl } from '../../../lib/activitypub/url' |
33 | import { JobQueue } from '../../../lib/job-queue/job-queue' | 33 | import { JobQueue } from '../../../lib/job-queue/job-queue' |
34 | import { createVideoMiniatureFromExisting, createVideoMiniatureFromUrl } from '../../../lib/thumbnail' | 34 | import { updateVideoMiniatureFromExisting, updateVideoMiniatureFromUrl } from '../../../lib/thumbnail' |
35 | import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' | 35 | import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist' |
36 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoImportAddValidator } from '../../../middlewares' | 36 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videoImportAddValidator } from '../../../middlewares' |
37 | import { VideoModel } from '../../../models/video/video' | 37 | import { VideoModel } from '../../../models/video/video' |
@@ -230,7 +230,7 @@ async function processThumbnail (req: express.Request, video: MVideoThumbnail) { | |||
230 | if (thumbnailField) { | 230 | if (thumbnailField) { |
231 | const thumbnailPhysicalFile = thumbnailField[0] | 231 | const thumbnailPhysicalFile = thumbnailField[0] |
232 | 232 | ||
233 | return createVideoMiniatureFromExisting({ | 233 | return updateVideoMiniatureFromExisting({ |
234 | inputPath: thumbnailPhysicalFile.path, | 234 | inputPath: thumbnailPhysicalFile.path, |
235 | video, | 235 | video, |
236 | type: ThumbnailType.MINIATURE, | 236 | type: ThumbnailType.MINIATURE, |
@@ -246,7 +246,7 @@ async function processPreview (req: express.Request, video: MVideoThumbnail): Pr | |||
246 | if (previewField) { | 246 | if (previewField) { |
247 | const previewPhysicalFile = previewField[0] | 247 | const previewPhysicalFile = previewField[0] |
248 | 248 | ||
249 | return createVideoMiniatureFromExisting({ | 249 | return updateVideoMiniatureFromExisting({ |
250 | inputPath: previewPhysicalFile.path, | 250 | inputPath: previewPhysicalFile.path, |
251 | video, | 251 | video, |
252 | type: ThumbnailType.PREVIEW, | 252 | type: ThumbnailType.PREVIEW, |
@@ -259,7 +259,7 @@ async function processPreview (req: express.Request, video: MVideoThumbnail): Pr | |||
259 | 259 | ||
260 | async function processThumbnailFromUrl (url: string, video: MVideoThumbnail) { | 260 | async function processThumbnailFromUrl (url: string, video: MVideoThumbnail) { |
261 | try { | 261 | try { |
262 | return createVideoMiniatureFromUrl({ downloadUrl: url, video, type: ThumbnailType.MINIATURE }) | 262 | return updateVideoMiniatureFromUrl({ downloadUrl: url, video, type: ThumbnailType.MINIATURE }) |
263 | } catch (err) { | 263 | } catch (err) { |
264 | logger.warn('Cannot generate video thumbnail %s for %s.', url, video.url, { err }) | 264 | logger.warn('Cannot generate video thumbnail %s for %s.', url, video.url, { err }) |
265 | return undefined | 265 | return undefined |
@@ -268,7 +268,7 @@ async function processThumbnailFromUrl (url: string, video: MVideoThumbnail) { | |||
268 | 268 | ||
269 | async function processPreviewFromUrl (url: string, video: MVideoThumbnail) { | 269 | async function processPreviewFromUrl (url: string, video: MVideoThumbnail) { |
270 | try { | 270 | try { |
271 | return createVideoMiniatureFromUrl({ downloadUrl: url, video, type: ThumbnailType.PREVIEW }) | 271 | return updateVideoMiniatureFromUrl({ downloadUrl: url, video, type: ThumbnailType.PREVIEW }) |
272 | } catch (err) { | 272 | } catch (err) { |
273 | logger.warn('Cannot generate video preview %s for %s.', url, video.url, { err }) | 273 | logger.warn('Cannot generate video preview %s for %s.', url, video.url, { err }) |
274 | return undefined | 274 | return undefined |
diff --git a/server/controllers/api/videos/live.ts b/server/controllers/api/videos/live.ts index 6b733c577..61fa979c4 100644 --- a/server/controllers/api/videos/live.ts +++ b/server/controllers/api/videos/live.ts | |||
@@ -13,7 +13,7 @@ import { MVideoDetails, MVideoFullLight } from '@server/types/models' | |||
13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' | 13 | import { LiveVideoCreate, LiveVideoUpdate, VideoState } from '../../../../shared' |
14 | import { logger } from '../../../helpers/logger' | 14 | import { logger } from '../../../helpers/logger' |
15 | import { sequelizeTypescript } from '../../../initializers/database' | 15 | import { sequelizeTypescript } from '../../../initializers/database' |
16 | import { createVideoMiniatureFromExisting } from '../../../lib/thumbnail' | 16 | import { updateVideoMiniatureFromExisting } from '../../../lib/thumbnail' |
17 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate } from '../../../middlewares' | 17 | import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate } from '../../../middlewares' |
18 | import { VideoModel } from '../../../models/video/video' | 18 | import { VideoModel } from '../../../models/video/video' |
19 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | 19 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' |
@@ -100,7 +100,7 @@ async function addLiveVideo (req: express.Request, res: express.Response) { | |||
100 | video, | 100 | video, |
101 | files: req.files, | 101 | files: req.files, |
102 | fallback: type => { | 102 | fallback: type => { |
103 | return createVideoMiniatureFromExisting({ | 103 | return updateVideoMiniatureFromExisting({ |
104 | inputPath: ASSETS_PATH.DEFAULT_LIVE_BACKGROUND, | 104 | inputPath: ASSETS_PATH.DEFAULT_LIVE_BACKGROUND, |
105 | video, | 105 | video, |
106 | type, | 106 | type, |