aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-22 20:58:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-25 17:32:16 +0200
commite02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch)
treeb7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/controllers
parent65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff)
downloadPeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip
Type models
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/clients.ts2
-rw-r--r--server/controllers/api/config.ts2
-rw-r--r--server/controllers/api/pods.ts6
-rw-r--r--server/controllers/api/remote/pods.ts4
-rw-r--r--server/controllers/api/remote/videos.ts2
-rw-r--r--server/controllers/api/users.ts4
-rw-r--r--server/controllers/api/videos/abuse.ts2
-rw-r--r--server/controllers/api/videos/blacklist.ts2
-rw-r--r--server/controllers/api/videos/index.ts2
-rw-r--r--server/controllers/api/videos/rate.ts2
-rw-r--r--server/controllers/client.ts7
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
3import { CONFIG } from '../../initializers'; 3import { CONFIG } from '../../initializers';
4import { logger } from '../../helpers' 4import { logger } from '../../helpers'
5const db = require('../../initializers/database') 5import { database as db } from '../../initializers/database'
6 6
7const clientsRouter = express.Router() 7const 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 @@
1import express = require('express') 1import express = require('express')
2 2
3import { CONFIG } from '../../initializers'; 3import { CONFIG } from '../../initializers'
4 4
5const configRouter = express.Router() 5const 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 @@
1import express = require('express') 1import express = require('express')
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4const db = require('../../initializers/database') 4import { database as db } from '../../initializers/database'
5import { CONFIG } from '../../initializers' 5import { CONFIG } from '../../initializers'
6import { 6import {
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)
40podsRouter.get('/quitfriends', 40podsRouter.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 @@
1import express = require('express') 1import express = require('express')
2import { waterfall } from 'async/waterfall' 2import * as waterfall from 'async/waterfall'
3 3
4const db = require('../../../initializers/database') 4import { database as db } from '../../../initializers/database'
5import { checkSignature, signatureValidator } from '../../../middlewares' 5import { checkSignature, signatureValidator } from '../../../middlewares'
6 6
7const remotePodsRouter = express.Router() 7const 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 @@
1import express = require('express') 1import express = require('express')
2import { eachSeries, waterfall } from 'async' 2import { eachSeries, waterfall } from 'async'
3 3
4const db = require('../../../initializers/database') 4import { database as db } from '../../../initializers/database'
5import { 5import {
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 @@
1import express = require('express') 1import express = require('express')
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4const db = require('../../initializers/database') 4import { database as db } from '../../initializers/database'
5import { CONFIG, USER_ROLES } from '../../initializers' 5import { CONFIG, USER_ROLES } from '../../initializers'
6import { logger, getFormatedObjects } from '../../helpers' 6import { logger, getFormatedObjects } from '../../helpers'
7import { 7import {
@@ -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 @@
1import express = require('express') 1import express = require('express')
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4const db = require('../../../initializers/database') 4import { database as db } from '../../../initializers/database'
5import friends = require('../../../lib/friends') 5import friends = require('../../../lib/friends')
6import { 6import {
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 @@
1import express = require('express') 1import express = require('express')
2 2
3const db = require('../../../initializers/database') 3import { database as db } from '../../../initializers/database'
4import { logger } from '../../../helpers' 4import { logger } from '../../../helpers'
5import { 5import {
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')
4import path = require('path') 4import path = require('path')
5import { waterfall } from 'async' 5import { waterfall } from 'async'
6 6
7const db = require('../../../initializers/database') 7import { database as db } from '../../../initializers/database'
8import { 8import {
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 @@
1import express = require('express') 1import express = require('express')
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4const db = require('../../../initializers/database') 4import { database as db } from '../../../initializers/database'
5import { 5import {
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
7const validator = expressValidator['validator'] 7const validator = expressValidator['validator']
8 8
9const db = require('../initializers/database') 9import { database as db } from '../initializers/database'
10import { 10import {
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'
16import { root } from '../helpers'
16 17
17const clientsRouter = express.Router() 18const clientsRouter = express.Router()
18 19
19// TODO: move to constants 20// TODO: move to constants
20const opengraphComment = '<!-- opengraph tags -->' 21const opengraphComment = '<!-- opengraph tags -->'
21const distPath = join(__dirname, '..', '..', 'client/dist') 22const distPath = join(root(), 'client', 'dist')
22const embedPath = join(distPath, 'standalone/videos/embed.html') 23const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
23const indexPath = join(distPath, 'index.html') 24const indexPath = join(distPath, 'index.html')
24 25
25// Special route that add OpenGraph tags 26// Special route that add OpenGraph tags