diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-17 10:35:27 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-17 10:35:27 +0200 |
commit | 164174a6abac3e391e95d479a98749e20eb86f34 (patch) | |
tree | 9fac6566299af7b86798cd07e181d269808eacbd /server/models | |
parent | 4b5dc9f1e452723503a3ef07405f80c793d7b5f7 (diff) | |
download | PeerTube-164174a6abac3e391e95d479a98749e20eb86f34.tar.gz PeerTube-164174a6abac3e391e95d479a98749e20eb86f34.tar.zst PeerTube-164174a6abac3e391e95d479a98749e20eb86f34.zip |
Use preview instead of thumbnail for oembed
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 0d0048b4a..fb18a485a 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -48,6 +48,7 @@ import { | |||
48 | 48 | ||
49 | VideoMethods | 49 | VideoMethods |
50 | } from './video-interface' | 50 | } from './video-interface' |
51 | import { PREVIEWS_SIZE } from '../../initializers/constants' | ||
51 | 52 | ||
52 | let Video: Sequelize.Model<VideoInstance, VideoAttributes> | 53 | let Video: Sequelize.Model<VideoInstance, VideoAttributes> |
53 | let getOriginalFile: VideoMethods.GetOriginalFile | 54 | let getOriginalFile: VideoMethods.GetOriginalFile |
@@ -373,10 +374,13 @@ isOwned = function (this: VideoInstance) { | |||
373 | } | 374 | } |
374 | 375 | ||
375 | createPreview = function (this: VideoInstance, videoFile: VideoFileInstance) { | 376 | createPreview = function (this: VideoInstance, videoFile: VideoFileInstance) { |
377 | const imageSize = PREVIEWS_SIZE.width + 'x' + PREVIEWS_SIZE.height | ||
378 | |||
376 | return generateImageFromVideoFile( | 379 | return generateImageFromVideoFile( |
377 | this.getVideoFilePath(videoFile), | 380 | this.getVideoFilePath(videoFile), |
378 | CONFIG.STORAGE.PREVIEWS_DIR, | 381 | CONFIG.STORAGE.PREVIEWS_DIR, |
379 | this.getPreviewName() | 382 | this.getPreviewName(), |
383 | imageSize | ||
380 | ) | 384 | ) |
381 | } | 385 | } |
382 | 386 | ||