diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 11:36:23 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 11:36:23 +0200 |
commit | 93e1258c7cbc0d1235ca6d2a1f7c1875985328b8 (patch) | |
tree | b0a1f77af7ab54dc5f58f569fcd1e9d84b04c533 /server/helpers/custom-validators/remote | |
parent | 69f224587e99d56008e1fa129d0641840a486620 (diff) | |
download | PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.gz PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.tar.zst PeerTube-93e1258c7cbc0d1235ca6d2a1f7c1875985328b8.zip |
Move video file metadata in their own table
Will be used for user video quotas and multiple video resolutions
Diffstat (limited to 'server/helpers/custom-validators/remote')
-rw-r--r-- | server/helpers/custom-validators/remote/videos.ts | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/remote/videos.ts b/server/helpers/custom-validators/remote/videos.ts index b33d8c9be..091cd2186 100644 --- a/server/helpers/custom-validators/remote/videos.ts +++ b/server/helpers/custom-validators/remote/videos.ts | |||
@@ -23,10 +23,11 @@ import { | |||
23 | isVideoNSFWValid, | 23 | isVideoNSFWValid, |
24 | isVideoDescriptionValid, | 24 | isVideoDescriptionValid, |
25 | isVideoDurationValid, | 25 | isVideoDurationValid, |
26 | isVideoInfoHashValid, | 26 | isVideoFileInfoHashValid, |
27 | isVideoNameValid, | 27 | isVideoNameValid, |
28 | isVideoTagsValid, | 28 | isVideoTagsValid, |
29 | isVideoExtnameValid | 29 | isVideoFileExtnameValid, |
30 | isVideoFileResolutionValid | ||
30 | } from '../videos' | 31 | } from '../videos' |
31 | 32 | ||
32 | const ENDPOINT_ACTIONS = REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] | 33 | const ENDPOINT_ACTIONS = REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] |
@@ -121,14 +122,22 @@ function isCommonVideoAttributesValid (video: any) { | |||
121 | isVideoNSFWValid(video.nsfw) && | 122 | isVideoNSFWValid(video.nsfw) && |
122 | isVideoDescriptionValid(video.description) && | 123 | isVideoDescriptionValid(video.description) && |
123 | isVideoDurationValid(video.duration) && | 124 | isVideoDurationValid(video.duration) && |
124 | isVideoInfoHashValid(video.infoHash) && | ||
125 | isVideoNameValid(video.name) && | 125 | isVideoNameValid(video.name) && |
126 | isVideoTagsValid(video.tags) && | 126 | isVideoTagsValid(video.tags) && |
127 | isVideoUUIDValid(video.uuid) && | 127 | isVideoUUIDValid(video.uuid) && |
128 | isVideoExtnameValid(video.extname) && | ||
129 | isVideoViewsValid(video.views) && | 128 | isVideoViewsValid(video.views) && |
130 | isVideoLikesValid(video.likes) && | 129 | isVideoLikesValid(video.likes) && |
131 | isVideoDislikesValid(video.dislikes) | 130 | isVideoDislikesValid(video.dislikes) && |
131 | isArray(video.files) && | ||
132 | video.files.every(videoFile => { | ||
133 | if (!videoFile) return false | ||
134 | |||
135 | return ( | ||
136 | isVideoFileInfoHashValid(videoFile.infoHash) && | ||
137 | isVideoFileExtnameValid(videoFile.extname) && | ||
138 | isVideoFileResolutionValid(videoFile.resolution) | ||
139 | ) | ||
140 | }) | ||
132 | } | 141 | } |
133 | 142 | ||
134 | function isRequestTypeAddValid (value: string) { | 143 | function isRequestTypeAddValid (value: string) { |