aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index d75b95f52..05019fcc2 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -165,20 +165,20 @@ export {
165// --------------------------------------------------------------------------- 165// ---------------------------------------------------------------------------
166 166
167async function getPreview (req: express.Request, res: express.Response) { 167async function getPreview (req: express.Request, res: express.Response) {
168 const path = await VideosPreviewCache.Instance.getFilePath(req.params.uuid) 168 const result = await VideosPreviewCache.Instance.getFilePath(req.params.uuid)
169 if (!path) return res.sendStatus(404) 169 if (!result) return res.sendStatus(404)
170 170
171 return res.sendFile(path, { maxAge: STATIC_MAX_AGE }) 171 return res.sendFile(result.path, { maxAge: STATIC_MAX_AGE })
172} 172}
173 173
174async function getVideoCaption (req: express.Request, res: express.Response) { 174async function getVideoCaption (req: express.Request, res: express.Response) {
175 const path = await VideosCaptionCache.Instance.getFilePath({ 175 const result = await VideosCaptionCache.Instance.getFilePath({
176 videoId: req.params.videoId, 176 videoId: req.params.videoId,
177 language: req.params.captionLanguage 177 language: req.params.captionLanguage
178 }) 178 })
179 if (!path) return res.sendStatus(404) 179 if (!result) return res.sendStatus(404)
180 180
181 return res.sendFile(path, { maxAge: STATIC_MAX_AGE }) 181 return res.sendFile(result.path, { maxAge: STATIC_MAX_AGE })
182} 182}
183 183
184async function generateNodeinfo (req: express.Request, res: express.Response, next: express.NextFunction) { 184async function generateNodeinfo (req: express.Request, res: express.Response, next: express.NextFunction) {