1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Server: fix thumbnail in remote videos

This commit is contained in:
Chocobozzz 2016-11-16 21:16:41 +01:00
parent 9c24c07051
commit c77fa067a1
2 changed files with 24 additions and 19 deletions

View file

@ -55,11 +55,15 @@ function remoteVideos (req, res, next) {
function addRemoteVideo (videoToCreateData, callback) {
logger.debug('Adding remote video %s.', videoToCreateData.magnetUri)
// Mongoose pre hook will automatically create the thumbnail on disk
videoToCreateData.thumbnail = videoToCreateData.thumbnailBase64
const video = new Video(videoToCreateData)
video.save(callback)
Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) {
if (err) {
logger.error('Cannot generate thumbnail from base 64 data.', { error: err })
return callback(err)
}
video.save(callback)
})
}
function removeRemoteVideo (videoToRemoveData, fromHost, callback) {