diff options
Diffstat (limited to 'server')
39 files changed, 144 insertions, 144 deletions
diff --git a/server/helpers/custom-validators/misc.js b/server/helpers/custom-validators/misc.js index 782ae3dee..052726241 100644 --- a/server/helpers/custom-validators/misc.js +++ b/server/helpers/custom-validators/misc.js | |||
@@ -1,8 +1,8 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const miscValidators = { | 3 | const miscValidators = { |
4 | exists: exists, | 4 | exists, |
5 | isArray: isArray | 5 | isArray |
6 | } | 6 | } |
7 | 7 | ||
8 | function exists (value) { | 8 | function exists (value) { |
diff --git a/server/helpers/custom-validators/pods.js b/server/helpers/custom-validators/pods.js index 28d04a05d..40f8b5d0b 100644 --- a/server/helpers/custom-validators/pods.js +++ b/server/helpers/custom-validators/pods.js | |||
@@ -5,7 +5,7 @@ const validator = require('express-validator').validator | |||
5 | const miscValidators = require('./misc') | 5 | const miscValidators = require('./misc') |
6 | 6 | ||
7 | const podsValidators = { | 7 | const podsValidators = { |
8 | isEachUniqueUrlValid: isEachUniqueUrlValid | 8 | isEachUniqueUrlValid |
9 | } | 9 | } |
10 | 10 | ||
11 | function isEachUniqueUrlValid (urls) { | 11 | function isEachUniqueUrlValid (urls) { |
diff --git a/server/helpers/custom-validators/users.js b/server/helpers/custom-validators/users.js index 0e92989e5..88fa1592e 100644 --- a/server/helpers/custom-validators/users.js +++ b/server/helpers/custom-validators/users.js | |||
@@ -7,9 +7,9 @@ const constants = require('../../initializers/constants') | |||
7 | const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS | 7 | const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS |
8 | 8 | ||
9 | const usersValidators = { | 9 | const usersValidators = { |
10 | isUserPasswordValid: isUserPasswordValid, | 10 | isUserPasswordValid, |
11 | isUserRoleValid: isUserRoleValid, | 11 | isUserRoleValid, |
12 | isUserUsernameValid: isUserUsernameValid | 12 | isUserUsernameValid |
13 | } | 13 | } |
14 | 14 | ||
15 | function isUserPasswordValid (value) { | 15 | function isUserPasswordValid (value) { |
diff --git a/server/helpers/custom-validators/videos.js b/server/helpers/custom-validators/videos.js index ebe927208..a507ff686 100644 --- a/server/helpers/custom-validators/videos.js +++ b/server/helpers/custom-validators/videos.js | |||
@@ -8,17 +8,17 @@ const miscValidators = require('./misc') | |||
8 | const VIDEOS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.VIDEOS | 8 | const VIDEOS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.VIDEOS |
9 | 9 | ||
10 | const videosValidators = { | 10 | const videosValidators = { |
11 | isEachRemoteVideosValid: isEachRemoteVideosValid, | 11 | isEachRemoteVideosValid, |
12 | isVideoAuthorValid: isVideoAuthorValid, | 12 | isVideoAuthorValid, |
13 | isVideoDateValid: isVideoDateValid, | 13 | isVideoDateValid, |
14 | isVideoDescriptionValid: isVideoDescriptionValid, | 14 | isVideoDescriptionValid, |
15 | isVideoDurationValid: isVideoDurationValid, | 15 | isVideoDurationValid, |
16 | isVideoMagnetUriValid: isVideoMagnetUriValid, | 16 | isVideoMagnetUriValid, |
17 | isVideoNameValid: isVideoNameValid, | 17 | isVideoNameValid, |
18 | isVideoPodUrlValid: isVideoPodUrlValid, | 18 | isVideoPodUrlValid, |
19 | isVideoTagsValid: isVideoTagsValid, | 19 | isVideoTagsValid, |
20 | isVideoThumbnailValid: isVideoThumbnailValid, | 20 | isVideoThumbnailValid, |
21 | isVideoThumbnail64Valid: isVideoThumbnail64Valid | 21 | isVideoThumbnail64Valid |
22 | } | 22 | } |
23 | 23 | ||
24 | function isEachRemoteVideosValid (requests) { | 24 | function isEachRemoteVideosValid (requests) { |
diff --git a/server/helpers/peertube-crypto.js b/server/helpers/peertube-crypto.js index 4783e9965..1ff638b04 100644 --- a/server/helpers/peertube-crypto.js +++ b/server/helpers/peertube-crypto.js | |||
@@ -12,13 +12,13 @@ const logger = require('./logger') | |||
12 | const algorithm = 'aes-256-ctr' | 12 | const algorithm = 'aes-256-ctr' |
13 | 13 | ||
14 | const peertubeCrypto = { | 14 | const peertubeCrypto = { |
15 | checkSignature: checkSignature, | 15 | checkSignature, |
16 | comparePassword: comparePassword, | 16 | comparePassword, |
17 | createCertsIfNotExist: createCertsIfNotExist, | 17 | createCertsIfNotExist, |
18 | cryptPassword: cryptPassword, | 18 | cryptPassword, |
19 | decrypt: decrypt, | 19 | decrypt, |
20 | encrypt: encrypt, | 20 | encrypt, |
21 | sign: sign | 21 | sign |
22 | } | 22 | } |
23 | 23 | ||
24 | function checkSignature (publicKey, rawData, hexSignature) { | 24 | function checkSignature (publicKey, rawData, hexSignature) { |
diff --git a/server/helpers/requests.js b/server/helpers/requests.js index f76ff3473..95775c981 100644 --- a/server/helpers/requests.js +++ b/server/helpers/requests.js | |||
@@ -7,8 +7,8 @@ const constants = require('../initializers/constants') | |||
7 | const peertubeCrypto = require('./peertube-crypto') | 7 | const peertubeCrypto = require('./peertube-crypto') |
8 | 8 | ||
9 | const requests = { | 9 | const requests = { |
10 | makeRetryRequest: makeRetryRequest, | 10 | makeRetryRequest, |
11 | makeSecureRequest: makeSecureRequest | 11 | makeSecureRequest |
12 | } | 12 | } |
13 | 13 | ||
14 | function makeRetryRequest (params, callback) { | 14 | function makeRetryRequest (params, callback) { |
diff --git a/server/helpers/utils.js b/server/helpers/utils.js index a77116e08..9c2d402e3 100644 --- a/server/helpers/utils.js +++ b/server/helpers/utils.js | |||
@@ -5,8 +5,8 @@ const crypto = require('crypto') | |||
5 | const logger = require('./logger') | 5 | const logger = require('./logger') |
6 | 6 | ||
7 | const utils = { | 7 | const utils = { |
8 | cleanForExit: cleanForExit, | 8 | cleanForExit, |
9 | generateRandomString: generateRandomString | 9 | generateRandomString |
10 | } | 10 | } |
11 | 11 | ||
12 | function generateRandomString (size, callback) { | 12 | function generateRandomString (size, callback) { |
diff --git a/server/initializers/checker.js b/server/initializers/checker.js index 2a33009b4..91fbcfaf9 100644 --- a/server/initializers/checker.js +++ b/server/initializers/checker.js | |||
@@ -7,9 +7,9 @@ const Client = mongoose.model('OAuthClient') | |||
7 | const User = mongoose.model('User') | 7 | const User = mongoose.model('User') |
8 | 8 | ||
9 | const checker = { | 9 | const checker = { |
10 | checkConfig: checkConfig, | 10 | checkConfig, |
11 | clientsExist: clientsExist, | 11 | clientsExist, |
12 | usersExist: usersExist | 12 | usersExist |
13 | } | 13 | } |
14 | 14 | ||
15 | // Check the config files | 15 | // Check the config files |
diff --git a/server/initializers/installer.js b/server/initializers/installer.js index 8c3148e79..1df300ba8 100644 --- a/server/initializers/installer.js +++ b/server/initializers/installer.js | |||
@@ -18,7 +18,7 @@ const Client = mongoose.model('OAuthClient') | |||
18 | const User = mongoose.model('User') | 18 | const User = mongoose.model('User') |
19 | 19 | ||
20 | const installer = { | 20 | const installer = { |
21 | installApplication: installApplication | 21 | installApplication |
22 | } | 22 | } |
23 | 23 | ||
24 | function installApplication (callback) { | 24 | function installApplication (callback) { |
@@ -107,9 +107,9 @@ function createOAuthAdminIfNotExist (callback) { | |||
107 | } | 107 | } |
108 | 108 | ||
109 | const user = new User({ | 109 | const user = new User({ |
110 | username: username, | 110 | username, |
111 | password: password, | 111 | password, |
112 | role: role | 112 | role |
113 | }) | 113 | }) |
114 | 114 | ||
115 | user.save(function (err, createdUser) { | 115 | user.save(function (err, createdUser) { |
diff --git a/server/lib/friends.js b/server/lib/friends.js index 6c4383d8e..556d2e773 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js | |||
@@ -17,13 +17,13 @@ const Request = mongoose.model('Request') | |||
17 | const Video = mongoose.model('Video') | 17 | const Video = mongoose.model('Video') |
18 | 18 | ||
19 | const friends = { | 19 | const friends = { |
20 | addVideoToFriends: addVideoToFriends, | 20 | addVideoToFriends, |
21 | hasFriends: hasFriends, | 21 | hasFriends, |
22 | getMyCertificate: getMyCertificate, | 22 | getMyCertificate, |
23 | makeFriends: makeFriends, | 23 | makeFriends, |
24 | quitFriends: quitFriends, | 24 | quitFriends, |
25 | removeVideoToFriends: removeVideoToFriends, | 25 | removeVideoToFriends, |
26 | sendOwnedVideosToPod: sendOwnedVideosToPod | 26 | sendOwnedVideosToPod |
27 | } | 27 | } |
28 | 28 | ||
29 | function addVideoToFriends (video) { | 29 | function addVideoToFriends (video) { |
diff --git a/server/lib/oauth-model.js b/server/lib/oauth-model.js index 6dab02fca..45f796796 100644 --- a/server/lib/oauth-model.js +++ b/server/lib/oauth-model.js | |||
@@ -8,12 +8,12 @@ const User = mongoose.model('User') | |||
8 | 8 | ||
9 | // See https://github.com/oauthjs/node-oauth2-server/wiki/Model-specification for the model specifications | 9 | // See https://github.com/oauthjs/node-oauth2-server/wiki/Model-specification for the model specifications |
10 | const OAuthModel = { | 10 | const OAuthModel = { |
11 | getAccessToken: getAccessToken, | 11 | getAccessToken, |
12 | getClient: getClient, | 12 | getClient, |
13 | getRefreshToken: getRefreshToken, | 13 | getRefreshToken, |
14 | getUser: getUser, | 14 | getUser, |
15 | revokeToken: revokeToken, | 15 | revokeToken, |
16 | saveToken: saveToken | 16 | saveToken |
17 | } | 17 | } |
18 | 18 | ||
19 | // --------------------------------------------------------------------------- | 19 | // --------------------------------------------------------------------------- |
diff --git a/server/middlewares/admin.js b/server/middlewares/admin.js index bcb60ab95..e6d9dc887 100644 --- a/server/middlewares/admin.js +++ b/server/middlewares/admin.js | |||
@@ -4,7 +4,7 @@ const constants = require('../initializers/constants') | |||
4 | const logger = require('../helpers/logger') | 4 | const logger = require('../helpers/logger') |
5 | 5 | ||
6 | const adminMiddleware = { | 6 | const adminMiddleware = { |
7 | ensureIsAdmin: ensureIsAdmin | 7 | ensureIsAdmin |
8 | } | 8 | } |
9 | 9 | ||
10 | function ensureIsAdmin (req, res, next) { | 10 | function ensureIsAdmin (req, res, next) { |
diff --git a/server/middlewares/oauth.js b/server/middlewares/oauth.js index 08584c41c..3a02b9b48 100644 --- a/server/middlewares/oauth.js +++ b/server/middlewares/oauth.js | |||
@@ -12,8 +12,8 @@ const oAuthServer = new OAuthServer({ | |||
12 | }) | 12 | }) |
13 | 13 | ||
14 | const oAuth = { | 14 | const oAuth = { |
15 | authenticate: authenticate, | 15 | authenticate, |
16 | token: token | 16 | token |
17 | } | 17 | } |
18 | 18 | ||
19 | function authenticate (req, res, next) { | 19 | function authenticate (req, res, next) { |
diff --git a/server/middlewares/pagination.js b/server/middlewares/pagination.js index a571e51f6..a90f60aab 100644 --- a/server/middlewares/pagination.js +++ b/server/middlewares/pagination.js | |||
@@ -3,7 +3,7 @@ | |||
3 | const constants = require('../initializers/constants') | 3 | const constants = require('../initializers/constants') |
4 | 4 | ||
5 | const paginationMiddleware = { | 5 | const paginationMiddleware = { |
6 | setPagination: setPagination | 6 | setPagination |
7 | } | 7 | } |
8 | 8 | ||
9 | function setPagination (req, res, next) { | 9 | function setPagination (req, res, next) { |
diff --git a/server/middlewares/pods.js b/server/middlewares/pods.js index 116b02b3c..6e0874a76 100644 --- a/server/middlewares/pods.js +++ b/server/middlewares/pods.js | |||
@@ -5,8 +5,8 @@ const urlModule = require('url') | |||
5 | const logger = require('../helpers/logger') | 5 | const logger = require('../helpers/logger') |
6 | 6 | ||
7 | const podsMiddleware = { | 7 | const podsMiddleware = { |
8 | setBodyUrlsPort: setBodyUrlsPort, | 8 | setBodyUrlsPort, |
9 | setBodyUrlPort: setBodyUrlPort | 9 | setBodyUrlPort |
10 | } | 10 | } |
11 | 11 | ||
12 | function setBodyUrlsPort (req, res, next) { | 12 | function setBodyUrlsPort (req, res, next) { |
diff --git a/server/middlewares/search.js b/server/middlewares/search.js index 89302a564..bb88faf54 100644 --- a/server/middlewares/search.js +++ b/server/middlewares/search.js | |||
@@ -1,7 +1,7 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const searchMiddleware = { | 3 | const searchMiddleware = { |
4 | setVideosSearch: setVideosSearch | 4 | setVideosSearch |
5 | } | 5 | } |
6 | 6 | ||
7 | function setVideosSearch (req, res, next) { | 7 | function setVideosSearch (req, res, next) { |
diff --git a/server/middlewares/secure.js b/server/middlewares/secure.js index 33a52e8d9..58f824d14 100644 --- a/server/middlewares/secure.js +++ b/server/middlewares/secure.js | |||
@@ -7,8 +7,8 @@ const peertubeCrypto = require('../helpers/peertube-crypto') | |||
7 | const Pod = mongoose.model('Pod') | 7 | const Pod = mongoose.model('Pod') |
8 | 8 | ||
9 | const secureMiddleware = { | 9 | const secureMiddleware = { |
10 | checkSignature: checkSignature, | 10 | checkSignature, |
11 | decryptBody: decryptBody | 11 | decryptBody |
12 | } | 12 | } |
13 | 13 | ||
14 | function checkSignature (req, res, next) { | 14 | function checkSignature (req, res, next) { |
diff --git a/server/middlewares/sort.js b/server/middlewares/sort.js index 8ed157805..f0b7274eb 100644 --- a/server/middlewares/sort.js +++ b/server/middlewares/sort.js | |||
@@ -1,8 +1,8 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const sortMiddleware = { | 3 | const sortMiddleware = { |
4 | setUsersSort: setUsersSort, | 4 | setUsersSort, |
5 | setVideosSort: setVideosSort | 5 | setVideosSort |
6 | } | 6 | } |
7 | 7 | ||
8 | function setUsersSort (req, res, next) { | 8 | function setUsersSort (req, res, next) { |
diff --git a/server/middlewares/validators/pagination.js b/server/middlewares/validators/pagination.js index 8e9a01053..16682696e 100644 --- a/server/middlewares/validators/pagination.js +++ b/server/middlewares/validators/pagination.js | |||
@@ -4,7 +4,7 @@ const checkErrors = require('./utils').checkErrors | |||
4 | const logger = require('../../helpers/logger') | 4 | const logger = require('../../helpers/logger') |
5 | 5 | ||
6 | const validatorsPagination = { | 6 | const validatorsPagination = { |
7 | pagination: pagination | 7 | pagination |
8 | } | 8 | } |
9 | 9 | ||
10 | function pagination (req, res, next) { | 10 | function pagination (req, res, next) { |
diff --git a/server/middlewares/validators/pods.js b/server/middlewares/validators/pods.js index 3c605c45e..fd3d1e2f2 100644 --- a/server/middlewares/validators/pods.js +++ b/server/middlewares/validators/pods.js | |||
@@ -5,8 +5,8 @@ const friends = require('../../lib/friends') | |||
5 | const logger = require('../../helpers/logger') | 5 | const logger = require('../../helpers/logger') |
6 | 6 | ||
7 | const validatorsPod = { | 7 | const validatorsPod = { |
8 | makeFriends: makeFriends, | 8 | makeFriends, |
9 | podsAdd: podsAdd | 9 | podsAdd |
10 | } | 10 | } |
11 | 11 | ||
12 | function makeFriends (req, res, next) { | 12 | function makeFriends (req, res, next) { |
diff --git a/server/middlewares/validators/remote.js b/server/middlewares/validators/remote.js index 87dc524a2..8c29ef8ca 100644 --- a/server/middlewares/validators/remote.js +++ b/server/middlewares/validators/remote.js | |||
@@ -4,9 +4,9 @@ const checkErrors = require('./utils').checkErrors | |||
4 | const logger = require('../../helpers/logger') | 4 | const logger = require('../../helpers/logger') |
5 | 5 | ||
6 | const validatorsRemote = { | 6 | const validatorsRemote = { |
7 | dataToDecrypt: dataToDecrypt, | 7 | dataToDecrypt, |
8 | remoteVideos: remoteVideos, | 8 | remoteVideos, |
9 | signature: signature | 9 | signature |
10 | } | 10 | } |
11 | 11 | ||
12 | function dataToDecrypt (req, res, next) { | 12 | function dataToDecrypt (req, res, next) { |
diff --git a/server/middlewares/validators/sort.js b/server/middlewares/validators/sort.js index 37b34ef52..431d3fffd 100644 --- a/server/middlewares/validators/sort.js +++ b/server/middlewares/validators/sort.js | |||
@@ -5,8 +5,8 @@ const constants = require('../../initializers/constants') | |||
5 | const logger = require('../../helpers/logger') | 5 | const logger = require('../../helpers/logger') |
6 | 6 | ||
7 | const validatorsSort = { | 7 | const validatorsSort = { |
8 | usersSort: usersSort, | 8 | usersSort, |
9 | videosSort: videosSort | 9 | videosSort |
10 | } | 10 | } |
11 | 11 | ||
12 | function usersSort (req, res, next) { | 12 | function usersSort (req, res, next) { |
diff --git a/server/middlewares/validators/users.js b/server/middlewares/validators/users.js index 5defdf4e3..d541e9124 100644 --- a/server/middlewares/validators/users.js +++ b/server/middlewares/validators/users.js | |||
@@ -8,9 +8,9 @@ const logger = require('../../helpers/logger') | |||
8 | const User = mongoose.model('User') | 8 | const User = mongoose.model('User') |
9 | 9 | ||
10 | const validatorsUsers = { | 10 | const validatorsUsers = { |
11 | usersAdd: usersAdd, | 11 | usersAdd, |
12 | usersRemove: usersRemove, | 12 | usersRemove, |
13 | usersUpdate: usersUpdate | 13 | usersUpdate |
14 | } | 14 | } |
15 | 15 | ||
16 | function usersAdd (req, res, next) { | 16 | function usersAdd (req, res, next) { |
diff --git a/server/middlewares/validators/utils.js b/server/middlewares/validators/utils.js index f6e5b2b38..3741b84c6 100644 --- a/server/middlewares/validators/utils.js +++ b/server/middlewares/validators/utils.js | |||
@@ -5,7 +5,7 @@ const util = require('util') | |||
5 | const logger = require('../../helpers/logger') | 5 | const logger = require('../../helpers/logger') |
6 | 6 | ||
7 | const validatorsUtils = { | 7 | const validatorsUtils = { |
8 | checkErrors: checkErrors | 8 | checkErrors |
9 | } | 9 | } |
10 | 10 | ||
11 | function checkErrors (req, res, next, statusCode) { | 11 | function checkErrors (req, res, next, statusCode) { |
diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js index e51087d5a..76e943e77 100644 --- a/server/middlewares/validators/videos.js +++ b/server/middlewares/validators/videos.js | |||
@@ -10,10 +10,10 @@ const logger = require('../../helpers/logger') | |||
10 | const Video = mongoose.model('Video') | 10 | const Video = mongoose.model('Video') |
11 | 11 | ||
12 | const validatorsVideos = { | 12 | const validatorsVideos = { |
13 | videosAdd: videosAdd, | 13 | videosAdd, |
14 | videosGet: videosGet, | 14 | videosGet, |
15 | videosRemove: videosRemove, | 15 | videosRemove, |
16 | videosSearch: videosSearch | 16 | videosSearch |
17 | } | 17 | } |
18 | 18 | ||
19 | function videosAdd (req, res, next) { | 19 | function videosAdd (req, res, next) { |
diff --git a/server/models/application.js b/server/models/application.js index 8185f0915..452ac4283 100644 --- a/server/models/application.js +++ b/server/models/application.js | |||
@@ -10,8 +10,8 @@ const ApplicationSchema = mongoose.Schema({ | |||
10 | }) | 10 | }) |
11 | 11 | ||
12 | ApplicationSchema.statics = { | 12 | ApplicationSchema.statics = { |
13 | loadMongoSchemaVersion: loadMongoSchemaVersion, | 13 | loadMongoSchemaVersion, |
14 | updateMongoSchemaVersion: updateMongoSchemaVersion | 14 | updateMongoSchemaVersion |
15 | } | 15 | } |
16 | 16 | ||
17 | mongoose.model('Application', ApplicationSchema) | 17 | mongoose.model('Application', ApplicationSchema) |
diff --git a/server/models/oauth-client.js b/server/models/oauth-client.js index 45834c5a5..a1aefa985 100644 --- a/server/models/oauth-client.js +++ b/server/models/oauth-client.js | |||
@@ -11,9 +11,9 @@ const OAuthClientSchema = mongoose.Schema({ | |||
11 | OAuthClientSchema.path('clientSecret').required(true) | 11 | OAuthClientSchema.path('clientSecret').required(true) |
12 | 12 | ||
13 | OAuthClientSchema.statics = { | 13 | OAuthClientSchema.statics = { |
14 | getByIdAndSecret: getByIdAndSecret, | 14 | getByIdAndSecret, |
15 | list: list, | 15 | list, |
16 | loadFirstClient: loadFirstClient | 16 | loadFirstClient |
17 | } | 17 | } |
18 | 18 | ||
19 | mongoose.model('OAuthClient', OAuthClientSchema) | 19 | mongoose.model('OAuthClient', OAuthClientSchema) |
diff --git a/server/models/oauth-token.js b/server/models/oauth-token.js index d53fdcf31..5beb47bed 100644 --- a/server/models/oauth-token.js +++ b/server/models/oauth-token.js | |||
@@ -18,10 +18,10 @@ OAuthTokenSchema.path('client').required(true) | |||
18 | OAuthTokenSchema.path('user').required(true) | 18 | OAuthTokenSchema.path('user').required(true) |
19 | 19 | ||
20 | OAuthTokenSchema.statics = { | 20 | OAuthTokenSchema.statics = { |
21 | getByRefreshTokenAndPopulateClient: getByRefreshTokenAndPopulateClient, | 21 | getByRefreshTokenAndPopulateClient, |
22 | getByTokenAndPopulateUser: getByTokenAndPopulateUser, | 22 | getByTokenAndPopulateUser, |
23 | getByRefreshToken: getByRefreshToken, | 23 | getByRefreshToken, |
24 | removeByUserId: removeByUserId | 24 | removeByUserId |
25 | } | 25 | } |
26 | 26 | ||
27 | mongoose.model('OAuthToken', OAuthTokenSchema) | 27 | mongoose.model('OAuthToken', OAuthTokenSchema) |
diff --git a/server/models/pods.js b/server/models/pods.js index 59de2d60c..4020a9603 100644 --- a/server/models/pods.js +++ b/server/models/pods.js | |||
@@ -24,18 +24,18 @@ PodSchema.path('publicKey').required(true) | |||
24 | PodSchema.path('score').validate(function (value) { return !isNaN(value) }) | 24 | PodSchema.path('score').validate(function (value) { return !isNaN(value) }) |
25 | 25 | ||
26 | PodSchema.methods = { | 26 | PodSchema.methods = { |
27 | toFormatedJSON: toFormatedJSON | 27 | toFormatedJSON |
28 | } | 28 | } |
29 | 29 | ||
30 | PodSchema.statics = { | 30 | PodSchema.statics = { |
31 | countAll: countAll, | 31 | countAll, |
32 | incrementScores: incrementScores, | 32 | incrementScores, |
33 | list: list, | 33 | list, |
34 | listAllIds: listAllIds, | 34 | listAllIds, |
35 | listBadPods: listBadPods, | 35 | listBadPods, |
36 | load: load, | 36 | load, |
37 | loadByUrl: loadByUrl, | 37 | loadByUrl, |
38 | removeAll: removeAll | 38 | removeAll |
39 | } | 39 | } |
40 | 40 | ||
41 | PodSchema.pre('save', function (next) { | 41 | PodSchema.pre('save', function (next) { |
diff --git a/server/models/user.js b/server/models/user.js index 91e8aeae1..a19de7072 100644 --- a/server/models/user.js +++ b/server/models/user.js | |||
@@ -23,17 +23,17 @@ UserSchema.path('username').required(customUsersValidators.isUserUsernameValid) | |||
23 | UserSchema.path('role').validate(customUsersValidators.isUserRoleValid) | 23 | UserSchema.path('role').validate(customUsersValidators.isUserRoleValid) |
24 | 24 | ||
25 | UserSchema.methods = { | 25 | UserSchema.methods = { |
26 | isPasswordMatch: isPasswordMatch, | 26 | isPasswordMatch, |
27 | toFormatedJSON: toFormatedJSON | 27 | toFormatedJSON |
28 | } | 28 | } |
29 | 29 | ||
30 | UserSchema.statics = { | 30 | UserSchema.statics = { |
31 | countTotal: countTotal, | 31 | countTotal, |
32 | getByUsername: getByUsername, | 32 | getByUsername, |
33 | list: list, | 33 | list, |
34 | listForApi: listForApi, | 34 | listForApi, |
35 | loadById: loadById, | 35 | loadById, |
36 | loadByUsername: loadByUsername | 36 | loadByUsername |
37 | } | 37 | } |
38 | 38 | ||
39 | UserSchema.pre('save', function (next) { | 39 | UserSchema.pre('save', function (next) { |
diff --git a/server/models/utils.js b/server/models/utils.js index a961e8c5b..e798aabe6 100644 --- a/server/models/utils.js +++ b/server/models/utils.js | |||
@@ -3,7 +3,7 @@ | |||
3 | const parallel = require('async/parallel') | 3 | const parallel = require('async/parallel') |
4 | 4 | ||
5 | const utils = { | 5 | const utils = { |
6 | listForApiWithCount: listForApiWithCount | 6 | listForApiWithCount |
7 | } | 7 | } |
8 | 8 | ||
9 | function listForApiWithCount (query, start, count, sort, callback) { | 9 | function listForApiWithCount (query, start, count, sort, callback) { |
diff --git a/server/models/video.js b/server/models/video.js index 0f60b6cd4..b9999c8f6 100644 --- a/server/models/video.js +++ b/server/models/video.js | |||
@@ -47,22 +47,22 @@ VideoSchema.path('thumbnail').validate(function (value) { | |||
47 | VideoSchema.path('tags').validate(customVideosValidators.isVideoTagsValid) | 47 | VideoSchema.path('tags').validate(customVideosValidators.isVideoTagsValid) |
48 | 48 | ||
49 | VideoSchema.methods = { | 49 | VideoSchema.methods = { |
50 | isOwned: isOwned, | 50 | isOwned, |
51 | toFormatedJSON: toFormatedJSON, | 51 | toFormatedJSON, |
52 | toRemoteJSON: toRemoteJSON | 52 | toRemoteJSON |
53 | } | 53 | } |
54 | 54 | ||
55 | VideoSchema.statics = { | 55 | VideoSchema.statics = { |
56 | getDurationFromFile: getDurationFromFile, | 56 | getDurationFromFile, |
57 | listForApi: listForApi, | 57 | listForApi, |
58 | listByUrlAndMagnet: listByUrlAndMagnet, | 58 | listByUrlAndMagnet, |
59 | listByUrls: listByUrls, | 59 | listByUrls, |
60 | listOwned: listOwned, | 60 | listOwned, |
61 | listOwnedByAuthor: listOwnedByAuthor, | 61 | listOwnedByAuthor, |
62 | listRemotes: listRemotes, | 62 | listRemotes, |
63 | load: load, | 63 | load, |
64 | search: search, | 64 | search, |
65 | seedAllExisting: seedAllExisting | 65 | seedAllExisting |
66 | } | 66 | } |
67 | 67 | ||
68 | VideoSchema.pre('remove', function (next) { | 68 | VideoSchema.pre('remove', function (next) { |
diff --git a/server/tests/utils/login.js b/server/tests/utils/login.js index 1a5d75bc4..465564e14 100644 --- a/server/tests/utils/login.js +++ b/server/tests/utils/login.js | |||
@@ -3,8 +3,8 @@ | |||
3 | const request = require('supertest') | 3 | const request = require('supertest') |
4 | 4 | ||
5 | const loginUtils = { | 5 | const loginUtils = { |
6 | login: login, | 6 | login, |
7 | loginAndGetAccessToken: loginAndGetAccessToken | 7 | loginAndGetAccessToken |
8 | } | 8 | } |
9 | 9 | ||
10 | // ---------------------- Export functions -------------------- | 10 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/miscs.js b/server/tests/utils/miscs.js index 5414cd561..4ceff65df 100644 --- a/server/tests/utils/miscs.js +++ b/server/tests/utils/miscs.js | |||
@@ -1,7 +1,7 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const miscsUtils = { | 3 | const miscsUtils = { |
4 | dateIsValid: dateIsValid | 4 | dateIsValid |
5 | } | 5 | } |
6 | 6 | ||
7 | // ---------------------- Export functions -------------------- | 7 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/pods.js b/server/tests/utils/pods.js index 9a9148856..a8551a49d 100644 --- a/server/tests/utils/pods.js +++ b/server/tests/utils/pods.js | |||
@@ -3,9 +3,9 @@ | |||
3 | const request = require('supertest') | 3 | const request = require('supertest') |
4 | 4 | ||
5 | const podsUtils = { | 5 | const podsUtils = { |
6 | getFriendsList: getFriendsList, | 6 | getFriendsList, |
7 | makeFriends: makeFriends, | 7 | makeFriends, |
8 | quitFriends: quitFriends | 8 | quitFriends |
9 | } | 9 | } |
10 | 10 | ||
11 | // ---------------------- Export functions -------------------- | 11 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/requests.js b/server/tests/utils/requests.js index 410e42c77..b1470814d 100644 --- a/server/tests/utils/requests.js +++ b/server/tests/utils/requests.js | |||
@@ -3,9 +3,9 @@ | |||
3 | const request = require('supertest') | 3 | const request = require('supertest') |
4 | 4 | ||
5 | const requestsUtils = { | 5 | const requestsUtils = { |
6 | makePostUploadRequest: makePostUploadRequest, | 6 | makePostUploadRequest, |
7 | makePostBodyRequest: makePostBodyRequest, | 7 | makePostBodyRequest, |
8 | makePutBodyRequest: makePutBodyRequest | 8 | makePutBodyRequest |
9 | } | 9 | } |
10 | 10 | ||
11 | // ---------------------- Export functions -------------------- | 11 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/servers.js b/server/tests/utils/servers.js index ee7cd8c0a..d62838bc7 100644 --- a/server/tests/utils/servers.js +++ b/server/tests/utils/servers.js | |||
@@ -6,9 +6,9 @@ const fork = childProcess.fork | |||
6 | const pathUtils = require('path') | 6 | const pathUtils = require('path') |
7 | 7 | ||
8 | const serversUtils = { | 8 | const serversUtils = { |
9 | flushAndRunMultipleServers: flushAndRunMultipleServers, | 9 | flushAndRunMultipleServers, |
10 | flushTests: flushTests, | 10 | flushTests, |
11 | runServer: runServer | 11 | runServer |
12 | } | 12 | } |
13 | 13 | ||
14 | // ---------------------- Export functions -------------------- | 14 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/users.js b/server/tests/utils/users.js index 0cf4e4adb..2bf9c6e3e 100644 --- a/server/tests/utils/users.js +++ b/server/tests/utils/users.js | |||
@@ -3,12 +3,12 @@ | |||
3 | const request = require('supertest') | 3 | const request = require('supertest') |
4 | 4 | ||
5 | const usersUtils = { | 5 | const usersUtils = { |
6 | createUser: createUser, | 6 | createUser, |
7 | getUserInformation: getUserInformation, | 7 | getUserInformation, |
8 | getUsersList: getUsersList, | 8 | getUsersList, |
9 | getUsersListPaginationAndSort: getUsersListPaginationAndSort, | 9 | getUsersListPaginationAndSort, |
10 | removeUser: removeUser, | 10 | removeUser, |
11 | updateUser: updateUser | 11 | updateUser |
12 | } | 12 | } |
13 | 13 | ||
14 | // ---------------------- Export functions -------------------- | 14 | // ---------------------- Export functions -------------------- |
diff --git a/server/tests/utils/videos.js b/server/tests/utils/videos.js index 90ee9621e..536093db1 100644 --- a/server/tests/utils/videos.js +++ b/server/tests/utils/videos.js | |||
@@ -5,17 +5,17 @@ const pathUtils = require('path') | |||
5 | const request = require('supertest') | 5 | const request = require('supertest') |
6 | 6 | ||
7 | const videosUtils = { | 7 | const videosUtils = { |
8 | getAllVideosListBy: getAllVideosListBy, | 8 | getAllVideosListBy, |
9 | getVideo: getVideo, | 9 | getVideo, |
10 | getVideosList: getVideosList, | 10 | getVideosList, |
11 | getVideosListPagination: getVideosListPagination, | 11 | getVideosListPagination, |
12 | getVideosListSort: getVideosListSort, | 12 | getVideosListSort, |
13 | removeVideo: removeVideo, | 13 | removeVideo, |
14 | searchVideo: searchVideo, | 14 | searchVideo, |
15 | searchVideoWithPagination: searchVideoWithPagination, | 15 | searchVideoWithPagination, |
16 | searchVideoWithSort: searchVideoWithSort, | 16 | searchVideoWithSort, |
17 | testVideoImage: testVideoImage, | 17 | testVideoImage, |
18 | uploadVideo: uploadVideo | 18 | uploadVideo |
19 | } | 19 | } |
20 | 20 | ||
21 | // ---------------------- Export functions -------------------- | 21 | // ---------------------- Export functions -------------------- |