aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/videos-caption-cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/files-cache/videos-caption-cache.ts')
-rw-r--r--server/lib/files-cache/videos-caption-cache.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/lib/files-cache/videos-caption-cache.ts b/server/lib/files-cache/videos-caption-cache.ts
index 2927c37eb..d21acf4ef 100644
--- a/server/lib/files-cache/videos-caption-cache.ts
+++ b/server/lib/files-cache/videos-caption-cache.ts
@@ -1,4 +1,5 @@
1import { join } from 'path' 1import { join } from 'path'
2import { logger } from '@server/helpers/logger'
2import { doRequestAndSaveToFile } from '@server/helpers/requests' 3import { doRequestAndSaveToFile } from '@server/helpers/requests'
3import { CONFIG } from '../../initializers/config' 4import { CONFIG } from '../../initializers/config'
4import { FILES_CACHE } from '../../initializers/constants' 5import { FILES_CACHE } from '../../initializers/constants'
@@ -41,9 +42,15 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <string> {
41 const remoteUrl = videoCaption.getFileUrl(video) 42 const remoteUrl = videoCaption.getFileUrl(video)
42 const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename) 43 const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename)
43 44
44 await doRequestAndSaveToFile(remoteUrl, destPath) 45 try {
46 await doRequestAndSaveToFile(remoteUrl, destPath)
45 47
46 return { isOwned: false, path: destPath } 48 return { isOwned: false, path: destPath }
49 } catch (err) {
50 logger.info('Cannot fetch remote caption file %s.', remoteUrl, { err })
51
52 return undefined
53 }
47 } 54 }
48} 55}
49 56