Fix preview 404
authorChocobozzz <me@florianbigard.com>
Thu, 28 Dec 2017 07:49:08 +0000 (08:49 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 28 Dec 2017 07:49:08 +0000 (08:49 +0100)
server/lib/activitypub/videos.ts
server/lib/cache/videos-preview-cache.ts

index ded854ee135034c8110d6915e3b73d07eff1c0fe..83f3e99331bbd559033a88eca96bec6e90069df1 100644 (file)
@@ -22,7 +22,9 @@ function fetchRemoteVideoPreview (video: VideoModel, reject: Function) {
   const host = video.VideoChannel.Account.Actor.Server.host
   const path = join(STATIC_PATHS.PREVIEWS, video.getPreviewName())
 
-  return request.get(REMOTE_SCHEME.HTTP + '://' + host + path, err => reject(err))
+  return request.get(REMOTE_SCHEME.HTTP + '://' + host + path, err => {
+    if (err) reject(err)
+  })
 }
 
 async function fetchRemoteVideoDescription (video: VideoModel) {
index ea959076d88c7614b0e4e7dac4f981029bf1eea0..930298dbe5fa67d2a066ae20ea7ea23b5d52d7af 100644 (file)
@@ -56,7 +56,6 @@ class VideosPreviewCache {
   }
 
   private saveRemotePreviewAndReturnPath (video: VideoModel) {
-
     return new Promise<string>((res, rej) => {
       const req = fetchRemoteVideoPreview(video, rej)
       const path = join(CACHE.DIRECTORIES.PREVIEWS, video.getPreviewName())