aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video.js')
-rw-r--r--server/models/video.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/models/video.js b/server/models/video.js
index 396aa505d..acb8353c2 100644
--- a/server/models/video.js
+++ b/server/models/video.js
@@ -9,7 +9,7 @@ const pathUtils = require('path')
9const mongoose = require('mongoose') 9const mongoose = require('mongoose')
10 10
11const constants = require('../initializers/constants') 11const constants = require('../initializers/constants')
12const customValidators = require('../helpers/custom-validators') 12const customVideosValidators = require('../helpers/custom-validators').videos
13const logger = require('../helpers/logger') 13const logger = require('../helpers/logger')
14const utils = require('../helpers/utils') 14const utils = require('../helpers/utils')
15const webtorrent = require('../lib/webtorrent') 15const webtorrent = require('../lib/webtorrent')
@@ -39,18 +39,18 @@ const VideoSchema = mongoose.Schema({
39 } 39 }
40}) 40})
41 41
42VideoSchema.path('name').validate(customValidators.isVideoNameValid) 42VideoSchema.path('name').validate(customVideosValidators.isVideoNameValid)
43VideoSchema.path('description').validate(customValidators.isVideoDescriptionValid) 43VideoSchema.path('description').validate(customVideosValidators.isVideoDescriptionValid)
44VideoSchema.path('magnetUri').validate(customValidators.isVideoMagnetUriValid) 44VideoSchema.path('magnetUri').validate(customVideosValidators.isVideoMagnetUriValid)
45VideoSchema.path('podUrl').validate(customValidators.isVideoPodUrlValid) 45VideoSchema.path('podUrl').validate(customVideosValidators.isVideoPodUrlValid)
46VideoSchema.path('author').validate(customValidators.isVideoAuthorValid) 46VideoSchema.path('author').validate(customVideosValidators.isVideoAuthorValid)
47VideoSchema.path('duration').validate(customValidators.isVideoDurationValid) 47VideoSchema.path('duration').validate(customVideosValidators.isVideoDurationValid)
48// The tumbnail can be the path or the data in base 64 48// The tumbnail can be the path or the data in base 64
49// The pre save hook will convert the base 64 data in a file on disk and replace the thumbnail key by the filename 49// The pre save hook will convert the base 64 data in a file on disk and replace the thumbnail key by the filename
50VideoSchema.path('thumbnail').validate(function (value) { 50VideoSchema.path('thumbnail').validate(function (value) {
51 return customValidators.isVideoThumbnailValid(value) || customValidators.isVideoThumbnail64Valid(value) 51 return customVideosValidators.isVideoThumbnailValid(value) || customVideosValidators.isVideoThumbnail64Valid(value)
52}) 52})
53VideoSchema.path('tags').validate(customValidators.isVideoTagsValid) 53VideoSchema.path('tags').validate(customVideosValidators.isVideoTagsValid)
54 54
55VideoSchema.methods = { 55VideoSchema.methods = {
56 isOwned: isOwned, 56 isOwned: isOwned,