aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-11 15:20:03 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commitf285faa04e84b45e62bd05e7050dc500113b0356 (patch)
treebae907d0714e435e92137347e0b892b806c5302c /server/helpers/custom-validators
parent558d7c2385d8a152a94140eed753f511e90986d7 (diff)
downloadPeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.gz
PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.tar.zst
PeerTube-f285faa04e84b45e62bd05e7050dc500113b0356.zip
Server: generate magnet uri on the fly
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/videos.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js
index c4c59808f..166158ef3 100644
--- a/server/helpers/custom-validators/videos.js
+++ b/server/helpers/custom-validators/videos.js
@@ -13,7 +13,7 @@ const videosValidators = {
13 isVideoDateValid, 13 isVideoDateValid,
14 isVideoDescriptionValid, 14 isVideoDescriptionValid,
15 isVideoDurationValid, 15 isVideoDurationValid,
16 isVideoMagnetUriValid, 16 isVideoMagnetValid,
17 isVideoNameValid, 17 isVideoNameValid,
18 isVideoPodUrlValid, 18 isVideoPodUrlValid,
19 isVideoTagsValid, 19 isVideoTagsValid,
@@ -31,7 +31,7 @@ function isEachRemoteVideosValid (requests) {
31 isVideoDateValid(video.createdDate) && 31 isVideoDateValid(video.createdDate) &&
32 isVideoDescriptionValid(video.description) && 32 isVideoDescriptionValid(video.description) &&
33 isVideoDurationValid(video.duration) && 33 isVideoDurationValid(video.duration) &&
34 isVideoMagnetUriValid(video.magnetUri) && 34 isVideoMagnetValid(video.magnetUri) &&
35 isVideoNameValid(video.name) && 35 isVideoNameValid(video.name) &&
36 isVideoPodUrlValid(video.podUrl) && 36 isVideoPodUrlValid(video.podUrl) &&
37 isVideoTagsValid(video.tags) && 37 isVideoTagsValid(video.tags) &&
@@ -62,8 +62,8 @@ function isVideoDurationValid (value) {
62 return validator.isInt(value + '', VIDEOS_CONSTRAINTS_FIELDS.DURATION) 62 return validator.isInt(value + '', VIDEOS_CONSTRAINTS_FIELDS.DURATION)
63} 63}
64 64
65function isVideoMagnetUriValid (value) { 65function isVideoMagnetValid (value) {
66 return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.MAGNET_URI) 66 return validator.isLength(value.infoHash, VIDEOS_CONSTRAINTS_FIELDS.MAGNET.XT)
67} 67}
68 68
69function isVideoNameValid (value) { 69function isVideoNameValid (value) {