X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fservices.ts;h=ec057235fbb3f6958694dc31330b10f23026e39f;hb=06a07ef63f076544421bf10d09b9ed4542819260;hp=352d0b19a8bb096c7e26d800fe5be499c4044573;hpb=40e87e9ecc54e3513fb586928330a7855eb192c6;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/services.ts b/server/controllers/services.ts index 352d0b19a..ec057235f 100644 --- a/server/controllers/services.ts +++ b/server/controllers/services.ts @@ -1,8 +1,7 @@ import * as express from 'express' -import { CONFIG, EMBED_SIZE, PREVIEWS_SIZE } from '../initializers' +import { EMBED_SIZE, PREVIEWS_SIZE, WEBSERVER } from '../initializers/constants' import { asyncMiddleware, oembedValidator } from '../middlewares' -import { accountsNameWithHostGetValidator } from '../middlewares/validators' -import { VideoModel } from '../models/video/video' +import { accountNameWithHostGetValidator } from '../middlewares/validators' const servicesRouter = express.Router() @@ -11,7 +10,7 @@ servicesRouter.use('/oembed', generateOEmbed ) servicesRouter.use('/redirect/accounts/:accountName', - asyncMiddleware(accountsNameWithHostGetValidator), + asyncMiddleware(accountNameWithHostGetValidator), redirectToAccountUrl ) @@ -23,9 +22,9 @@ export { // --------------------------------------------------------------------------- -function generateOEmbed (req: express.Request, res: express.Response, next: express.NextFunction) { - const video = res.locals.video as VideoModel - const webserverUrl = CONFIG.WEBSERVER.URL +function generateOEmbed (req: express.Request, res: express.Response) { + const video = res.locals.videoAll + const webserverUrl = WEBSERVER.URL const maxHeight = parseInt(req.query.maxheight, 10) const maxWidth = parseInt(req.query.maxwidth, 10)