X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fdownload.ts;h=65b9a1d1b740bb1199ee3d5e5ce909e59db3416b;hb=4638cd713dcdd007cd7f49b9a95fa62ac7823e7c;hp=d9f34109f360dc1cdf2477e1e56edff0af812b2c;hpb=6bcb559fc9a491fc3ce83e7c077ee9dc742b1d63;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/download.ts b/server/controllers/download.ts index d9f34109f..65b9a1d1b 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts @@ -5,7 +5,7 @@ import { VideosTorrentCache } from '@server/lib/files-cache/videos-torrent-cache import { Hooks } from '@server/lib/plugins/hooks' import { VideoPathManager } from '@server/lib/video-path-manager' import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' -import { addQueryParams } from '@shared/core-utils' +import { addQueryParams, forceNumber } from '@shared/core-utils' import { HttpStatusCode, VideoStorage, VideoStreamingPlaylistType } from '@shared/models' import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' import { asyncMiddleware, optionalAuthenticate, videosDownloadValidator } from '../middlewares' @@ -132,7 +132,7 @@ async function downloadHLSVideoFile (req: express.Request, res: express.Response } function getVideoFile (req: express.Request, files: MVideoFile[]) { - const resolution = parseInt(req.params.resolution, 10) + const resolution = forceNumber(req.params.resolution) return files.find(f => f.resolution === resolution) }