diff options
Diffstat (limited to 'server/models/video.js')
-rw-r--r-- | server/models/video.js | 18 |
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') | |||
9 | const mongoose = require('mongoose') | 9 | const mongoose = require('mongoose') |
10 | 10 | ||
11 | const constants = require('../initializers/constants') | 11 | const constants = require('../initializers/constants') |
12 | const customValidators = require('../helpers/custom-validators') | 12 | const customVideosValidators = require('../helpers/custom-validators').videos |
13 | const logger = require('../helpers/logger') | 13 | const logger = require('../helpers/logger') |
14 | const utils = require('../helpers/utils') | 14 | const utils = require('../helpers/utils') |
15 | const webtorrent = require('../lib/webtorrent') | 15 | const webtorrent = require('../lib/webtorrent') |
@@ -39,18 +39,18 @@ const VideoSchema = mongoose.Schema({ | |||
39 | } | 39 | } |
40 | }) | 40 | }) |
41 | 41 | ||
42 | VideoSchema.path('name').validate(customValidators.isVideoNameValid) | 42 | VideoSchema.path('name').validate(customVideosValidators.isVideoNameValid) |
43 | VideoSchema.path('description').validate(customValidators.isVideoDescriptionValid) | 43 | VideoSchema.path('description').validate(customVideosValidators.isVideoDescriptionValid) |
44 | VideoSchema.path('magnetUri').validate(customValidators.isVideoMagnetUriValid) | 44 | VideoSchema.path('magnetUri').validate(customVideosValidators.isVideoMagnetUriValid) |
45 | VideoSchema.path('podUrl').validate(customValidators.isVideoPodUrlValid) | 45 | VideoSchema.path('podUrl').validate(customVideosValidators.isVideoPodUrlValid) |
46 | VideoSchema.path('author').validate(customValidators.isVideoAuthorValid) | 46 | VideoSchema.path('author').validate(customVideosValidators.isVideoAuthorValid) |
47 | VideoSchema.path('duration').validate(customValidators.isVideoDurationValid) | 47 | VideoSchema.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 |
50 | VideoSchema.path('thumbnail').validate(function (value) { | 50 | VideoSchema.path('thumbnail').validate(function (value) { |
51 | return customValidators.isVideoThumbnailValid(value) || customValidators.isVideoThumbnail64Valid(value) | 51 | return customVideosValidators.isVideoThumbnailValid(value) || customVideosValidators.isVideoThumbnail64Valid(value) |
52 | }) | 52 | }) |
53 | VideoSchema.path('tags').validate(customValidators.isVideoTagsValid) | 53 | VideoSchema.path('tags').validate(customVideosValidators.isVideoTagsValid) |
54 | 54 | ||
55 | VideoSchema.methods = { | 55 | VideoSchema.methods = { |
56 | isOwned: isOwned, | 56 | isOwned: isOwned, |