aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/videos.js3
-rw-r--r--server/helpers/custom-validators/remote/videos.js3
-rw-r--r--server/models/video.js6
3 files changed, 8 insertions, 4 deletions
diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js
index dfd8699e6..5a67d1121 100644
--- a/server/controllers/api/videos.js
+++ b/server/controllers/api/videos.js
@@ -155,7 +155,8 @@ function addVideo (req, res, videoFile, finalCallback) {
155 extname: path.extname(videoFile.filename), 155 extname: path.extname(videoFile.filename),
156 description: videoInfos.description, 156 description: videoInfos.description,
157 duration: videoFile.duration, 157 duration: videoFile.duration,
158 authorId: author.id 158 authorId: author.id,
159 views: videoInfos.views
159 } 160 }
160 161
161 const video = db.Video.build(videoData) 162 const video = db.Video.build(videoData)
diff --git a/server/helpers/custom-validators/remote/videos.js b/server/helpers/custom-validators/remote/videos.js
index c1786014d..ba2d0bb93 100644
--- a/server/helpers/custom-validators/remote/videos.js
+++ b/server/helpers/custom-validators/remote/videos.js
@@ -91,7 +91,8 @@ function isCommonVideoAttributesValid (video) {
91 videosValidators.isVideoNameValid(video.name) && 91 videosValidators.isVideoNameValid(video.name) &&
92 videosValidators.isVideoTagsValid(video.tags) && 92 videosValidators.isVideoTagsValid(video.tags) &&
93 videosValidators.isVideoRemoteIdValid(video.remoteId) && 93 videosValidators.isVideoRemoteIdValid(video.remoteId) &&
94 videosValidators.isVideoExtnameValid(video.extname) 94 videosValidators.isVideoExtnameValid(video.extname) &&
95 videosValidators.isVideoViewsValid(video.views)
95} 96}
96 97
97function isRequestTypeAddValid (value) { 98function isRequestTypeAddValid (value) {
diff --git a/server/models/video.js b/server/models/video.js
index daa273845..fb46aca86 100644
--- a/server/models/video.js
+++ b/server/models/video.js
@@ -380,7 +380,8 @@ function toAddRemoteJSON (callback) {
380 tags: map(self.Tags, 'name'), 380 tags: map(self.Tags, 'name'),
381 createdAt: self.createdAt, 381 createdAt: self.createdAt,
382 updatedAt: self.updatedAt, 382 updatedAt: self.updatedAt,
383 extname: self.extname 383 extname: self.extname,
384 views: self.views
384 } 385 }
385 386
386 return callback(null, remoteVideo) 387 return callback(null, remoteVideo)
@@ -398,7 +399,8 @@ function toUpdateRemoteJSON (callback) {
398 tags: map(this.Tags, 'name'), 399 tags: map(this.Tags, 'name'),
399 createdAt: this.createdAt, 400 createdAt: this.createdAt,
400 updatedAt: this.updatedAt, 401 updatedAt: this.updatedAt,
401 extname: this.extname 402 extname: this.extname,
403 views: this.views
402 } 404 }
403 405
404 return json 406 return json