Fix last commit

This commit is contained in:
Chocobozzz
2018-07-26 10:45:10 +02:00
parent c1e791bad0
commit 2cebd79701
9 changed files with 24 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, tr
}) as VideoCaptionModel[]
}
if (isNewVideo === true) {
if (isNewVideo) {
// Now we'll add the video's meta data to our followers
await sendCreateVideo(video, transaction)
await shareVideoByServerAndChannel(video, transaction)
@@ -153,9 +153,7 @@ function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObje
if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href)
const parsed = magnetUtil.decode(magnet.href)
if (!parsed ||
(parsed.infoHash &&
(isVideoFileInfoHashValid(parsed.infoHash) === false))) {
if (!parsed || isVideoFileInfoHashValid(parsed.infoHash) === false) {
throw new Error('Cannot parse magnet URI ' + magnet.href)
}

View File

@@ -6,8 +6,8 @@ import { CONFIG, USER_PASSWORD_RESET_LIFETIME, VIDEO_VIEW_LIFETIME } from '../in
type CachedRoute = {
body: string,
contentType: string
statusCode: string
contentType?: string
statusCode?: string
}
class Redis {