diff options
Diffstat (limited to 'server/lib/files-cache/videos-caption-cache.ts')
-rw-r--r-- | server/lib/files-cache/videos-caption-cache.ts | 11 |
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 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { logger } from '@server/helpers/logger' | ||
2 | import { doRequestAndSaveToFile } from '@server/helpers/requests' | 3 | import { doRequestAndSaveToFile } from '@server/helpers/requests' |
3 | import { CONFIG } from '../../initializers/config' | 4 | import { CONFIG } from '../../initializers/config' |
4 | import { FILES_CACHE } from '../../initializers/constants' | 5 | import { 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 | ||