diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts index f88d26561..95fe824b9 100644 --- a/server/helpers/custom-validators/activitypub/videos.ts +++ b/server/helpers/custom-validators/activitypub/videos.ts | |||
@@ -81,19 +81,20 @@ function isRemoteVideoUrlValid (url: any) { | |||
81 | 81 | ||
82 | return url.type === 'Link' && | 82 | return url.type === 'Link' && |
83 | ( | 83 | ( |
84 | ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mimeType) !== -1 && | 84 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) |
85 | ACTIVITY_PUB.URL_MIME_TYPES.VIDEO.indexOf(url.mediaType || url.mimeType) !== -1 && | ||
85 | isActivityPubUrlValid(url.href) && | 86 | isActivityPubUrlValid(url.href) && |
86 | validator.isInt(url.height + '', { min: 0 }) && | 87 | validator.isInt(url.height + '', { min: 0 }) && |
87 | validator.isInt(url.size + '', { min: 0 }) && | 88 | validator.isInt(url.size + '', { min: 0 }) && |
88 | (!url.fps || validator.isInt(url.fps + '', { min: -1 })) | 89 | (!url.fps || validator.isInt(url.fps + '', { min: -1 })) |
89 | ) || | 90 | ) || |
90 | ( | 91 | ( |
91 | ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mimeType) !== -1 && | 92 | ACTIVITY_PUB.URL_MIME_TYPES.TORRENT.indexOf(url.mediaType || url.mimeType) !== -1 && |
92 | isActivityPubUrlValid(url.href) && | 93 | isActivityPubUrlValid(url.href) && |
93 | validator.isInt(url.height + '', { min: 0 }) | 94 | validator.isInt(url.height + '', { min: 0 }) |
94 | ) || | 95 | ) || |
95 | ( | 96 | ( |
96 | ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mimeType) !== -1 && | 97 | ACTIVITY_PUB.URL_MIME_TYPES.MAGNET.indexOf(url.mediaType || url.mimeType) !== -1 && |
97 | validator.isLength(url.href, { min: 5 }) && | 98 | validator.isLength(url.href, { min: 5 }) && |
98 | validator.isInt(url.height + '', { min: 0 }) | 99 | validator.isInt(url.height + '', { min: 0 }) |
99 | ) | 100 | ) |