aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/activitypub/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index 22b5e14a2..af8c8a0c8 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -84,19 +84,19 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
84function isRemoteVideoUrlValid (url: any) { 84function isRemoteVideoUrlValid (url: any) {
85 return url.type === 'Link' && 85 return url.type === 'Link' &&
86 ( 86 (
87 ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mediaType) !== -1 && 87 ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.includes(url.mediaType) &&
88 isActivityPubUrlValid(url.href) && 88 isActivityPubUrlValid(url.href) &&
89 validator.isInt(url.height + '', { min: 0 }) && 89 validator.isInt(url.height + '', { min: 0 }) &&
90 validator.isInt(url.size + '', { min: 0 }) && 90 validator.isInt(url.size + '', { min: 0 }) &&
91 (!url.fps || validator.isInt(url.fps + '', { min: -1 })) 91 (!url.fps || validator.isInt(url.fps + '', { min: -1 }))
92 ) || 92 ) ||
93 ( 93 (
94 ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mediaType) !== -1 && 94 ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.includes(url.mediaType) &&
95 isActivityPubUrlValid(url.href) && 95 isActivityPubUrlValid(url.href) &&
96 validator.isInt(url.height + '', { min: 0 }) 96 validator.isInt(url.height + '', { min: 0 })
97 ) || 97 ) ||
98 ( 98 (
99 ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mediaType) !== -1 && 99 ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.includes(url.mediaType) &&
100 validator.isLength(url.href, { min: 5 }) && 100 validator.isLength(url.href, { min: 5 }) &&
101 validator.isInt(url.height + '', { min: 0 }) 101 validator.isInt(url.height + '', { min: 0 })
102 ) || 102 ) ||