aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-26 10:45:10 +0200
committerChocobozzz <me@florianbigard.com>2018-07-26 11:02:04 +0200
commit2cebd797014561ebc0bfee07ee8b5d83820adb66 (patch)
treefe912e29c7321c3c29e94691520615a741899e71 /server/lib
parentc1e791bad0b079af67398f6407221e6dcbb573dd (diff)
downloadPeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.tar.gz
PeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.tar.zst
PeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.zip
Fix last commit
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/videos.ts6
-rw-r--r--server/lib/redis.ts4
2 files changed, 4 insertions, 6 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 2944cb729..b6f57e0ab 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -38,7 +38,7 @@ async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, tr
38 }) as VideoCaptionModel[] 38 }) as VideoCaptionModel[]
39 } 39 }
40 40
41 if (isNewVideo === true) { 41 if (isNewVideo) {
42 // Now we'll add the video's meta data to our followers 42 // Now we'll add the video's meta data to our followers
43 await sendCreateVideo(video, transaction) 43 await sendCreateVideo(video, transaction)
44 await shareVideoByServerAndChannel(video, transaction) 44 await shareVideoByServerAndChannel(video, transaction)
@@ -153,9 +153,7 @@ function videoFileActivityUrlToDBAttributes (videoCreated: VideoModel, videoObje
153 if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href) 153 if (!magnet) throw new Error('Cannot find associated magnet uri for file ' + fileUrl.href)
154 154
155 const parsed = magnetUtil.decode(magnet.href) 155 const parsed = magnetUtil.decode(magnet.href)
156 if (!parsed || 156 if (!parsed || isVideoFileInfoHashValid(parsed.infoHash) === false) {
157 (parsed.infoHash &&
158 (isVideoFileInfoHashValid(parsed.infoHash) === false))) {
159 throw new Error('Cannot parse magnet URI ' + magnet.href) 157 throw new Error('Cannot parse magnet URI ' + magnet.href)
160 } 158 }
161 159
diff --git a/server/lib/redis.ts b/server/lib/redis.ts
index e547537c3..941f7d557 100644
--- a/server/lib/redis.ts
+++ b/server/lib/redis.ts
@@ -6,8 +6,8 @@ import { CONFIG, USER_PASSWORD_RESET_LIFETIME, VIDEO_VIEW_LIFETIME } from '../in
6 6
7type CachedRoute = { 7type CachedRoute = {
8 body: string, 8 body: string,
9 contentType: string 9 contentType?: string
10 statusCode: string 10 statusCode?: string
11} 11}
12 12
13class Redis { 13class Redis {