From db4b15f21fbf4e33434e930ffc7fb768cdcf9d42 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Mar 2021 14:24:11 +0100 Subject: Use got instead of request --- server/lib/files-cache/videos-caption-cache.ts | 2 +- server/lib/files-cache/videos-preview-cache.ts | 2 +- server/lib/files-cache/videos-torrent-cache.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/files-cache') diff --git a/server/lib/files-cache/videos-caption-cache.ts b/server/lib/files-cache/videos-caption-cache.ts index ee0447010..58e2260b6 100644 --- a/server/lib/files-cache/videos-caption-cache.ts +++ b/server/lib/files-cache/videos-caption-cache.ts @@ -41,7 +41,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache { const remoteUrl = videoCaption.getFileUrl(video) const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename) - await doRequestAndSaveToFile({ uri: remoteUrl }, destPath) + await doRequestAndSaveToFile(remoteUrl, destPath) return { isOwned: false, path: destPath } } diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts index ee72cd3f9..dd3a84aca 100644 --- a/server/lib/files-cache/videos-preview-cache.ts +++ b/server/lib/files-cache/videos-preview-cache.ts @@ -39,7 +39,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache { const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, preview.filename) const remoteUrl = preview.getFileUrl(video) - await doRequestAndSaveToFile({ uri: remoteUrl }, destPath) + await doRequestAndSaveToFile(remoteUrl, destPath) logger.debug('Fetched remote preview %s to %s.', remoteUrl, destPath) diff --git a/server/lib/files-cache/videos-torrent-cache.ts b/server/lib/files-cache/videos-torrent-cache.ts index ca0e1770d..881fa9ced 100644 --- a/server/lib/files-cache/videos-torrent-cache.ts +++ b/server/lib/files-cache/videos-torrent-cache.ts @@ -41,7 +41,7 @@ class VideosTorrentCache extends AbstractVideoStaticFileCache { const remoteUrl = file.getRemoteTorrentUrl(video) const destPath = join(FILES_CACHE.TORRENTS.DIRECTORY, file.torrentFilename) - await doRequestAndSaveToFile({ uri: remoteUrl }, destPath) + await doRequestAndSaveToFile(remoteUrl, destPath) const downloadName = `${video.name}-${file.resolution}p.torrent` -- cgit v1.2.3