aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-28 08:49:08 +0100
committerChocobozzz <me@florianbigard.com>2017-12-28 08:49:08 +0100
commitf40bbe3146553ef45515ee6b6d93ce6028f045ca (patch)
tree0f4190e652864916c19b4c5bf1acea57108d068b /server
parentd50acfab69ce9e05b272dea6c4d34d52960ba14c (diff)
downloadPeerTube-f40bbe3146553ef45515ee6b6d93ce6028f045ca.tar.gz
PeerTube-f40bbe3146553ef45515ee6b6d93ce6028f045ca.tar.zst
PeerTube-f40bbe3146553ef45515ee6b6d93ce6028f045ca.zip
Fix preview 404
Diffstat (limited to 'server')
-rw-r--r--server/lib/activitypub/videos.ts4
-rw-r--r--server/lib/cache/videos-preview-cache.ts1
2 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index ded854ee1..83f3e9933 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -22,7 +22,9 @@ function fetchRemoteVideoPreview (video: VideoModel, reject: Function) {
22 const host = video.VideoChannel.Account.Actor.Server.host 22 const host = video.VideoChannel.Account.Actor.Server.host
23 const path = join(STATIC_PATHS.PREVIEWS, video.getPreviewName()) 23 const path = join(STATIC_PATHS.PREVIEWS, video.getPreviewName())
24 24
25 return request.get(REMOTE_SCHEME.HTTP + '://' + host + path, err => reject(err)) 25 return request.get(REMOTE_SCHEME.HTTP + '://' + host + path, err => {
26 if (err) reject(err)
27 })
26} 28}
27 29
28async function fetchRemoteVideoDescription (video: VideoModel) { 30async function fetchRemoteVideoDescription (video: VideoModel) {
diff --git a/server/lib/cache/videos-preview-cache.ts b/server/lib/cache/videos-preview-cache.ts
index ea959076d..930298dbe 100644
--- a/server/lib/cache/videos-preview-cache.ts
+++ b/server/lib/cache/videos-preview-cache.ts
@@ -56,7 +56,6 @@ class VideosPreviewCache {
56 } 56 }
57 57
58 private saveRemotePreviewAndReturnPath (video: VideoModel) { 58 private saveRemotePreviewAndReturnPath (video: VideoModel) {
59
60 return new Promise<string>((res, rej) => { 59 return new Promise<string>((res, rej) => {
61 const req = fetchRemoteVideoPreview(video, rej) 60 const req = fetchRemoteVideoPreview(video, rej)
62 const path = join(CACHE.DIRECTORIES.PREVIEWS, video.getPreviewName()) 61 const path = join(CACHE.DIRECTORIES.PREVIEWS, video.getPreviewName())