diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-01 16:54:24 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-01 16:54:24 +0200 |
commit | 65af03a241aa83ab7ba71278b6c99acd26428b8a (patch) | |
tree | 0cc04c31cdf631d11a915ae40389e8fa141f136b /server/controllers/api/videos | |
parent | a21e25ff641854c8b01664cb18655aa420620af6 (diff) | |
download | PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.tar.gz PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.tar.zst PeerTube-65af03a241aa83ab7ba71278b6c99acd26428b8a.zip |
Automatically update playlist thumbnails
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/import.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 1f08fe20a..04c9b547b 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -207,7 +207,7 @@ async function processThumbnail (req: express.Request, video: VideoModel) { | |||
207 | if (thumbnailField) { | 207 | if (thumbnailField) { |
208 | const thumbnailPhysicalFile = thumbnailField[ 0 ] | 208 | const thumbnailPhysicalFile = thumbnailField[ 0 ] |
209 | 209 | ||
210 | return createVideoMiniatureFromExisting(thumbnailPhysicalFile.path, video, ThumbnailType.MINIATURE) | 210 | return createVideoMiniatureFromExisting(thumbnailPhysicalFile.path, video, ThumbnailType.MINIATURE, false) |
211 | } | 211 | } |
212 | 212 | ||
213 | return undefined | 213 | return undefined |
@@ -218,7 +218,7 @@ async function processPreview (req: express.Request, video: VideoModel) { | |||
218 | if (previewField) { | 218 | if (previewField) { |
219 | const previewPhysicalFile = previewField[0] | 219 | const previewPhysicalFile = previewField[0] |
220 | 220 | ||
221 | return createVideoMiniatureFromExisting(previewPhysicalFile.path, video, ThumbnailType.PREVIEW) | 221 | return createVideoMiniatureFromExisting(previewPhysicalFile.path, video, ThumbnailType.PREVIEW, false) |
222 | } | 222 | } |
223 | 223 | ||
224 | return undefined | 224 | return undefined |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 973bf1123..155ca4678 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -223,13 +223,13 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
223 | // Process thumbnail or create it from the video | 223 | // Process thumbnail or create it from the video |
224 | const thumbnailField = req.files['thumbnailfile'] | 224 | const thumbnailField = req.files['thumbnailfile'] |
225 | const thumbnailModel = thumbnailField | 225 | const thumbnailModel = thumbnailField |
226 | ? await createVideoMiniatureFromExisting(thumbnailField[0].path, video, ThumbnailType.MINIATURE) | 226 | ? await createVideoMiniatureFromExisting(thumbnailField[0].path, video, ThumbnailType.MINIATURE, false) |
227 | : await generateVideoMiniature(video, videoFile, ThumbnailType.MINIATURE) | 227 | : await generateVideoMiniature(video, videoFile, ThumbnailType.MINIATURE) |
228 | 228 | ||
229 | // Process preview or create it from the video | 229 | // Process preview or create it from the video |
230 | const previewField = req.files['previewfile'] | 230 | const previewField = req.files['previewfile'] |
231 | const previewModel = previewField | 231 | const previewModel = previewField |
232 | ? await createVideoMiniatureFromExisting(previewField[0].path, video, ThumbnailType.PREVIEW) | 232 | ? await createVideoMiniatureFromExisting(previewField[0].path, video, ThumbnailType.PREVIEW, false) |
233 | : await generateVideoMiniature(video, videoFile, ThumbnailType.PREVIEW) | 233 | : await generateVideoMiniature(video, videoFile, ThumbnailType.PREVIEW) |
234 | 234 | ||
235 | // Create the torrent file | 235 | // Create the torrent file |
@@ -329,11 +329,11 @@ async function updateVideo (req: express.Request, res: express.Response) { | |||
329 | 329 | ||
330 | // Process thumbnail or create it from the video | 330 | // Process thumbnail or create it from the video |
331 | const thumbnailModel = req.files && req.files['thumbnailfile'] | 331 | const thumbnailModel = req.files && req.files['thumbnailfile'] |
332 | ? await createVideoMiniatureFromExisting(req.files['thumbnailfile'][0].path, videoInstance, ThumbnailType.MINIATURE) | 332 | ? await createVideoMiniatureFromExisting(req.files['thumbnailfile'][0].path, videoInstance, ThumbnailType.MINIATURE, false) |
333 | : undefined | 333 | : undefined |
334 | 334 | ||
335 | const previewModel = req.files && req.files['previewfile'] | 335 | const previewModel = req.files && req.files['previewfile'] |
336 | ? await createVideoMiniatureFromExisting(req.files['previewfile'][0].path, videoInstance, ThumbnailType.PREVIEW) | 336 | ? await createVideoMiniatureFromExisting(req.files['previewfile'][0].path, videoInstance, ThumbnailType.PREVIEW, false) |
337 | : undefined | 337 | : undefined |
338 | 338 | ||
339 | try { | 339 | try { |