diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-19 21:34:51 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-19 21:34:51 +0200 |
commit | e861452fb26553177ad4e32bfb18b4fd8a5b1816 (patch) | |
tree | 7c0cfd464709243a452b431665f5107a973df682 /server/controllers/api/v1/videos.js | |
parent | 5c39adb7313e0696aabb4b71196ab7b0b378c359 (diff) | |
download | PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.gz PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.tar.zst PeerTube-e861452fb26553177ad4e32bfb18b4fd8a5b1816.zip |
Server: put config in constants
Diffstat (limited to 'server/controllers/api/v1/videos.js')
-rw-r--r-- | server/controllers/api/v1/videos.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js index 0a441f146..70d22f139 100644 --- a/server/controllers/api/v1/videos.js +++ b/server/controllers/api/v1/videos.js | |||
@@ -1,11 +1,11 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const config = require('config') | ||
4 | const express = require('express') | 3 | const express = require('express') |
5 | const mongoose = require('mongoose') | 4 | const mongoose = require('mongoose') |
6 | const multer = require('multer') | 5 | const multer = require('multer') |
7 | const waterfall = require('async/waterfall') | 6 | const waterfall = require('async/waterfall') |
8 | 7 | ||
8 | const constants = require('../../../initializers/constants') | ||
9 | const logger = require('../../../helpers/logger') | 9 | const logger = require('../../../helpers/logger') |
10 | const friends = require('../../../lib/friends') | 10 | const friends = require('../../../lib/friends') |
11 | const middlewares = require('../../../middlewares') | 11 | const middlewares = require('../../../middlewares') |
@@ -20,13 +20,12 @@ const sort = middlewares.sort | |||
20 | const utils = require('../../../helpers/utils') | 20 | const utils = require('../../../helpers/utils') |
21 | 21 | ||
22 | const router = express.Router() | 22 | const router = express.Router() |
23 | const uploads = config.get('storage.uploads') | ||
24 | const Video = mongoose.model('Video') | 23 | const Video = mongoose.model('Video') |
25 | 24 | ||
26 | // multer configuration | 25 | // multer configuration |
27 | const storage = multer.diskStorage({ | 26 | const storage = multer.diskStorage({ |
28 | destination: function (req, file, cb) { | 27 | destination: function (req, file, cb) { |
29 | cb(null, uploads) | 28 | cb(null, constants.CONFIG.STORAGE.UPLOAD_DIR) |
30 | }, | 29 | }, |
31 | 30 | ||
32 | filename: function (req, file, cb) { | 31 | filename: function (req, file, cb) { |