1
0
Fork 0

Fix preview 404

This commit is contained in:
Chocobozzz 2017-12-28 08:49:08 +01:00
parent d50acfab69
commit f40bbe3146
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 3 additions and 2 deletions

View 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) {

View 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())