diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/remote.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/controllers/api/remote.js b/server/controllers/api/remote.js index 4085deb2d..3e2aa6375 100644 --- a/server/controllers/api/remote.js +++ b/server/controllers/api/remote.js | |||
@@ -55,11 +55,15 @@ function remoteVideos (req, res, next) { | |||
55 | function addRemoteVideo (videoToCreateData, callback) { | 55 | function addRemoteVideo (videoToCreateData, callback) { |
56 | logger.debug('Adding remote video %s.', videoToCreateData.magnetUri) | 56 | logger.debug('Adding remote video %s.', videoToCreateData.magnetUri) |
57 | 57 | ||
58 | // Mongoose pre hook will automatically create the thumbnail on disk | ||
59 | videoToCreateData.thumbnail = videoToCreateData.thumbnailBase64 | ||
60 | |||
61 | const video = new Video(videoToCreateData) | 58 | const video = new Video(videoToCreateData) |
62 | video.save(callback) | 59 | Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) { |
60 | if (err) { | ||
61 | logger.error('Cannot generate thumbnail from base 64 data.', { error: err }) | ||
62 | return callback(err) | ||
63 | } | ||
64 | |||
65 | video.save(callback) | ||
66 | }) | ||
63 | } | 67 | } |
64 | 68 | ||
65 | function removeRemoteVideo (videoToRemoveData, fromHost, callback) { | 69 | function removeRemoteVideo (videoToRemoveData, fromHost, callback) { |