X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Ffiles-cache%2Fvideos-preview-cache.ts;h=dd3a84aca60a7c8fe5d0dbf7c6a3676bea57d3aa;hb=63a3d336f6cc9a293a07fdc12d6bdfb86cfc2fd5;hp=47488da74cad94e501562392a79f6ec72a9dbd91;hpb=6302d599cdf98b5a5363a2a1dcdc266447950191;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts index 47488da74..dd3a84aca 100644 --- a/server/lib/files-cache/videos-preview-cache.ts +++ b/server/lib/files-cache/videos-preview-cache.ts @@ -20,7 +20,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache { } async getFilePathImpl (filename: string) { - const thumbnail = await ThumbnailModel.loadWithVideoByName(filename, ThumbnailType.PREVIEW) + const thumbnail = await ThumbnailModel.loadWithVideoByFilename(filename, ThumbnailType.PREVIEW) if (!thumbnail) return undefined if (thumbnail.Video.isOwned()) return { isOwned: true, path: thumbnail.getPath() } @@ -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)