diff options
Diffstat (limited to 'server/lib/files-cache/videos-preview-cache.ts')
-rw-r--r-- | server/lib/files-cache/videos-preview-cache.ts | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts index b7a8d6105..48d2cb52c 100644 --- a/server/lib/files-cache/videos-preview-cache.ts +++ b/server/lib/files-cache/videos-preview-cache.ts | |||
@@ -37,13 +37,19 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { | |||
37 | 37 | ||
38 | const preview = video.getPreview() | 38 | const preview = video.getPreview() |
39 | const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, preview.filename) | 39 | const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, preview.filename) |
40 | |||
41 | const remoteUrl = preview.getFileUrl(video) | 40 | const remoteUrl = preview.getFileUrl(video) |
42 | await doRequestAndSaveToFile(remoteUrl, destPath) | ||
43 | 41 | ||
44 | logger.debug('Fetched remote preview %s to %s.', remoteUrl, destPath) | 42 | try { |
43 | await doRequestAndSaveToFile(remoteUrl, destPath) | ||
44 | |||
45 | logger.debug('Fetched remote preview %s to %s.', remoteUrl, destPath) | ||
46 | |||
47 | return { isOwned: false, path: destPath } | ||
48 | } catch (err) { | ||
49 | logger.info('Cannot fetch remote preview file %s.', remoteUrl, { err }) | ||
45 | 50 | ||
46 | return { isOwned: false, path: destPath } | 51 | return undefined |
52 | } | ||
47 | } | 53 | } |
48 | } | 54 | } |
49 | 55 | ||