aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos.ts
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/activitypub/videos.ts
parentc1e791bad0b079af67398f6407221e6dcbb573dd (diff)
downloadPeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.tar.gz
PeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.tar.zst
PeerTube-2cebd797014561ebc0bfee07ee8b5d83820adb66.zip
Fix last commit
Diffstat (limited to 'server/lib/activitypub/videos.ts')
-rw-r--r--server/lib/activitypub/videos.ts6
1 files changed, 2 insertions, 4 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