diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/index.ts | 6 | ||||
-rw-r--r-- | server/controllers/client.ts | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index e70a5319e..815881df3 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -49,11 +49,11 @@ const videosRouter = express.Router() | |||
49 | 49 | ||
50 | // multer configuration | 50 | // multer configuration |
51 | const storage = multer.diskStorage({ | 51 | const storage = multer.diskStorage({ |
52 | destination: function (req, file, cb) { | 52 | destination: (req, file, cb) => { |
53 | cb(null, CONFIG.STORAGE.VIDEOS_DIR) | 53 | cb(null, CONFIG.STORAGE.VIDEOS_DIR) |
54 | }, | 54 | }, |
55 | 55 | ||
56 | filename: function (req, file, cb) { | 56 | filename: (req, file, cb) => { |
57 | let extension = '' | 57 | let extension = '' |
58 | if (file.mimetype === 'video/webm') extension = 'webm' | 58 | if (file.mimetype === 'video/webm') extension = 'webm' |
59 | else if (file.mimetype === 'video/mp4') extension = 'mp4' | 59 | else if (file.mimetype === 'video/mp4') extension = 'mp4' |
@@ -310,7 +310,7 @@ function updateVideo (req: express.Request, res: express.Response) { | |||
310 | // Force fields we want to update | 310 | // Force fields we want to update |
311 | // If the transaction is retried, sequelize will think the object has not changed | 311 | // If the transaction is retried, sequelize will think the object has not changed |
312 | // So it will skip the SQL request, even if the last one was ROLLBACKed! | 312 | // So it will skip the SQL request, even if the last one was ROLLBACKed! |
313 | Object.keys(videoFieldsSave).forEach(function (key) { | 313 | Object.keys(videoFieldsSave).forEach(key => { |
314 | const value = videoFieldsSave[key] | 314 | const value = videoFieldsSave[key] |
315 | videoInstance.set(key, value) | 315 | videoInstance.set(key, value) |
316 | }) | 316 | }) |
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index ac722a578..d913f81b8 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -24,7 +24,7 @@ const indexPath = join(distPath, 'index.html') | |||
24 | // Do not use a template engine for a so little thing | 24 | // Do not use a template engine for a so little thing |
25 | clientsRouter.use('/videos/watch/:id', generateWatchHtmlPage) | 25 | clientsRouter.use('/videos/watch/:id', generateWatchHtmlPage) |
26 | 26 | ||
27 | clientsRouter.use('/videos/embed', function (req: express.Request, res: express.Response, next: express.NextFunction) { | 27 | clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response, next: express.NextFunction) => { |
28 | res.sendFile(embedPath) | 28 | res.sendFile(embedPath) |
29 | }) | 29 | }) |
30 | 30 | ||
@@ -32,7 +32,7 @@ clientsRouter.use('/videos/embed', function (req: express.Request, res: express. | |||
32 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) | 32 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) |
33 | 33 | ||
34 | // 404 for static files not found | 34 | // 404 for static files not found |
35 | clientsRouter.use('/client/*', function (req: express.Request, res: express.Response, next: express.NextFunction) { | 35 | clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => { |
36 | res.sendStatus(404) | 36 | res.sendStatus(404) |
37 | }) | 37 | }) |
38 | 38 | ||