aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-17 10:35:27 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-17 10:35:27 +0200
commit164174a6abac3e391e95d479a98749e20eb86f34 (patch)
tree9fac6566299af7b86798cd07e181d269808eacbd /server/models
parent4b5dc9f1e452723503a3ef07405f80c793d7b5f7 (diff)
downloadPeerTube-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.ts6
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'
51import { PREVIEWS_SIZE } from '../../initializers/constants'
51 52
52let Video: Sequelize.Model<VideoInstance, VideoAttributes> 53let Video: Sequelize.Model<VideoInstance, VideoAttributes>
53let getOriginalFile: VideoMethods.GetOriginalFile 54let getOriginalFile: VideoMethods.GetOriginalFile
@@ -373,10 +374,13 @@ isOwned = function (this: VideoInstance) {
373} 374}
374 375
375createPreview = function (this: VideoInstance, videoFile: VideoFileInstance) { 376createPreview = 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