diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/download.ts | 4 | ||||
-rw-r--r-- | server/tests/api/check-params/config.ts | 2 | ||||
-rw-r--r-- | server/tests/api/server/config.ts | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/server/controllers/download.ts b/server/controllers/download.ts index 43d525f83..a270180c0 100644 --- a/server/controllers/download.ts +++ b/server/controllers/download.ts | |||
@@ -86,7 +86,9 @@ async function downloadVideoFile (req: express.Request, res: express.Response) { | |||
86 | } | 86 | } |
87 | 87 | ||
88 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => { | 88 | await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(video), path => { |
89 | const filename = `${video.name}-${videoFile.resolution}p${videoFile.extname}` | 89 | // Express uses basename on filename parameter |
90 | const videoName = video.name.replace(/[/\\]/g, '_') | ||
91 | const filename = `${videoName}-${videoFile.resolution}p${videoFile.extname}` | ||
90 | 92 | ||
91 | return res.download(path, filename) | 93 | return res.download(path, filename) |
92 | }) | 94 | }) |
diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index c8dbbf797..99fb24a5b 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts | |||
@@ -165,7 +165,7 @@ describe('Test config API validators', function () { | |||
165 | trending: { | 165 | trending: { |
166 | videos: { | 166 | videos: { |
167 | algorithms: { | 167 | algorithms: { |
168 | enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ], | 168 | enabled: [ 'hot', 'most-viewed', 'most-liked' ], |
169 | default: 'most-viewed' | 169 | default: 'most-viewed' |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index f31012a5c..0f2fb5493 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts | |||
@@ -367,7 +367,7 @@ const newCustomConfig: CustomConfig = { | |||
367 | trending: { | 367 | trending: { |
368 | videos: { | 368 | videos: { |
369 | algorithms: { | 369 | algorithms: { |
370 | enabled: [ 'best', 'hot', 'most-viewed', 'most-liked' ], | 370 | enabled: [ 'hot', 'most-viewed', 'most-liked' ], |
371 | default: 'hot' | 371 | default: 'hot' |
372 | } | 372 | } |
373 | } | 373 | } |