diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/clients.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/config.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/pods.ts | 6 | ||||
-rw-r--r-- | server/controllers/api/remote/pods.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/remote/videos.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/users.ts | 4 | ||||
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/rate.ts | 2 | ||||
-rw-r--r-- | server/controllers/client.ts | 7 |
11 files changed, 18 insertions, 17 deletions
diff --git a/server/controllers/api/clients.ts b/server/controllers/api/clients.ts index 902f62995..614163c83 100644 --- a/server/controllers/api/clients.ts +++ b/server/controllers/api/clients.ts | |||
@@ -2,7 +2,7 @@ import express = require('express') | |||
2 | 2 | ||
3 | import { CONFIG } from '../../initializers'; | 3 | import { CONFIG } from '../../initializers'; |
4 | import { logger } from '../../helpers' | 4 | import { logger } from '../../helpers' |
5 | const db = require('../../initializers/database') | 5 | import { database as db } from '../../initializers/database' |
6 | 6 | ||
7 | const clientsRouter = express.Router() | 7 | const clientsRouter = express.Router() |
8 | 8 | ||
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 8f3fa2473..8bdde61b3 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | 2 | ||
3 | import { CONFIG } from '../../initializers'; | 3 | import { CONFIG } from '../../initializers' |
4 | 4 | ||
5 | const configRouter = express.Router() | 5 | const configRouter = express.Router() |
6 | 6 | ||
diff --git a/server/controllers/api/pods.ts b/server/controllers/api/pods.ts index 06dfd8295..4ff1f5d9f 100644 --- a/server/controllers/api/pods.ts +++ b/server/controllers/api/pods.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | const db = require('../../initializers/database') | 4 | import { database as db } from '../../initializers/database' |
5 | import { CONFIG } from '../../initializers' | 5 | import { CONFIG } from '../../initializers' |
6 | import { | 6 | import { |
7 | logger, | 7 | logger, |
@@ -35,12 +35,12 @@ podsRouter.post('/makefriends', | |||
35 | ensureIsAdmin, | 35 | ensureIsAdmin, |
36 | makeFriendsValidator, | 36 | makeFriendsValidator, |
37 | setBodyHostsPort, | 37 | setBodyHostsPort, |
38 | makeFriends | 38 | makeFriendsController |
39 | ) | 39 | ) |
40 | podsRouter.get('/quitfriends', | 40 | podsRouter.get('/quitfriends', |
41 | authenticate, | 41 | authenticate, |
42 | ensureIsAdmin, | 42 | ensureIsAdmin, |
43 | quitFriends | 43 | quitFriendsController |
44 | ) | 44 | ) |
45 | 45 | ||
46 | // --------------------------------------------------------------------------- | 46 | // --------------------------------------------------------------------------- |
diff --git a/server/controllers/api/remote/pods.ts b/server/controllers/api/remote/pods.ts index 85ef7bb42..7a9a0c4f0 100644 --- a/server/controllers/api/remote/pods.ts +++ b/server/controllers/api/remote/pods.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { waterfall } from 'async/waterfall' | 2 | import * as waterfall from 'async/waterfall' |
3 | 3 | ||
4 | const db = require('../../../initializers/database') | 4 | import { database as db } from '../../../initializers/database' |
5 | import { checkSignature, signatureValidator } from '../../../middlewares' | 5 | import { checkSignature, signatureValidator } from '../../../middlewares' |
6 | 6 | ||
7 | const remotePodsRouter = express.Router() | 7 | const remotePodsRouter = express.Router() |
diff --git a/server/controllers/api/remote/videos.ts b/server/controllers/api/remote/videos.ts index df4ba8309..178a21e7c 100644 --- a/server/controllers/api/remote/videos.ts +++ b/server/controllers/api/remote/videos.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { eachSeries, waterfall } from 'async' | 2 | import { eachSeries, waterfall } from 'async' |
3 | 3 | ||
4 | const db = require('../../../initializers/database') | 4 | import { database as db } from '../../../initializers/database' |
5 | import { | 5 | import { |
6 | REQUEST_ENDPOINT_ACTIONS, | 6 | REQUEST_ENDPOINT_ACTIONS, |
7 | REQUEST_ENDPOINTS, | 7 | REQUEST_ENDPOINTS, |
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts index 981a4706a..97a744f54 100644 --- a/server/controllers/api/users.ts +++ b/server/controllers/api/users.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | const db = require('../../initializers/database') | 4 | import { database as db } from '../../initializers/database' |
5 | import { CONFIG, USER_ROLES } from '../../initializers' | 5 | import { CONFIG, USER_ROLES } from '../../initializers' |
6 | import { logger, getFormatedObjects } from '../../helpers' | 6 | import { logger, getFormatedObjects } from '../../helpers' |
7 | import { | 7 | import { |
@@ -114,7 +114,7 @@ function getUserVideoRating (req, res, next) { | |||
114 | const videoId = req.params.videoId | 114 | const videoId = req.params.videoId |
115 | const userId = res.locals.oauth.token.User.id | 115 | const userId = res.locals.oauth.token.User.id |
116 | 116 | ||
117 | db.UserVideoRate.load(userId, videoId, function (err, ratingObj) { | 117 | db.UserVideoRate.load(userId, videoId, null, function (err, ratingObj) { |
118 | if (err) return next(err) | 118 | if (err) return next(err) |
119 | 119 | ||
120 | const rating = ratingObj ? ratingObj.type : 'none' | 120 | const rating = ratingObj ? ratingObj.type : 'none' |
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index 88204120f..3dd884354 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | const db = require('../../../initializers/database') | 4 | import { database as db } from '../../../initializers/database' |
5 | import friends = require('../../../lib/friends') | 5 | import friends = require('../../../lib/friends') |
6 | import { | 6 | import { |
7 | logger, | 7 | logger, |
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index db6d95e73..fb4d57d7b 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | 2 | ||
3 | const db = require('../../../initializers/database') | 3 | import { database as db } from '../../../initializers/database' |
4 | import { logger } from '../../../helpers' | 4 | import { logger } from '../../../helpers' |
5 | import { | 5 | import { |
6 | authenticate, | 6 | authenticate, |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 5fbf03676..6eda7159b 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -4,7 +4,7 @@ import multer = require('multer') | |||
4 | import path = require('path') | 4 | import path = require('path') |
5 | import { waterfall } from 'async' | 5 | import { waterfall } from 'async' |
6 | 6 | ||
7 | const db = require('../../../initializers/database') | 7 | import { database as db } from '../../../initializers/database' |
8 | import { | 8 | import { |
9 | CONFIG, | 9 | CONFIG, |
10 | REQUEST_VIDEO_QADU_TYPES, | 10 | REQUEST_VIDEO_QADU_TYPES, |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 21053792a..571ff68e3 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import express = require('express') | 1 | import express = require('express') |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | const db = require('../../../initializers/database') | 4 | import { database as db } from '../../../initializers/database' |
5 | import { | 5 | import { |
6 | logger, | 6 | logger, |
7 | retryTransactionWrapper, | 7 | retryTransactionWrapper, |
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index aaa04889a..ce5608c9b 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -6,20 +6,21 @@ import expressValidator = require('express-validator') | |||
6 | // TODO: use .validator when express-validator typing will have validator field | 6 | // TODO: use .validator when express-validator typing will have validator field |
7 | const validator = expressValidator['validator'] | 7 | const validator = expressValidator['validator'] |
8 | 8 | ||
9 | const db = require('../initializers/database') | 9 | import { database as db } from '../initializers/database' |
10 | import { | 10 | import { |
11 | CONFIG, | 11 | CONFIG, |
12 | REMOTE_SCHEME, | 12 | REMOTE_SCHEME, |
13 | STATIC_PATHS, | 13 | STATIC_PATHS, |
14 | STATIC_MAX_AGE | 14 | STATIC_MAX_AGE |
15 | } from '../initializers' | 15 | } from '../initializers' |
16 | import { root } from '../helpers' | ||
16 | 17 | ||
17 | const clientsRouter = express.Router() | 18 | const clientsRouter = express.Router() |
18 | 19 | ||
19 | // TODO: move to constants | 20 | // TODO: move to constants |
20 | const opengraphComment = '<!-- opengraph tags -->' | 21 | const opengraphComment = '<!-- opengraph tags -->' |
21 | const distPath = join(__dirname, '..', '..', 'client/dist') | 22 | const distPath = join(root(), 'client', 'dist') |
22 | const embedPath = join(distPath, 'standalone/videos/embed.html') | 23 | const embedPath = join(distPath, 'standalone', 'videos', 'embed.html') |
23 | const indexPath = join(distPath, 'index.html') | 24 | const indexPath = join(distPath, 'index.html') |
24 | 25 | ||
25 | // Special route that add OpenGraph tags | 26 | // Special route that add OpenGraph tags |