diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/application.js | 4 | ||||
-rw-r--r-- | server/models/oauth-client.js | 6 | ||||
-rw-r--r-- | server/models/oauth-token.js | 8 | ||||
-rw-r--r-- | server/models/pods.js | 18 | ||||
-rw-r--r-- | server/models/user.js | 16 | ||||
-rw-r--r-- | server/models/utils.js | 2 | ||||
-rw-r--r-- | server/models/video.js | 26 |
7 files changed, 40 insertions, 40 deletions
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) { |