From ca6d36227a9273f616a462d3aad6a721ab5dd627 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jan 2020 11:53:38 +0100 Subject: Add url field in caption and use it for thumbnails --- server/lib/files-cache/videos-caption-cache.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'server/lib/files-cache/videos-caption-cache.ts') diff --git a/server/lib/files-cache/videos-caption-cache.ts b/server/lib/files-cache/videos-caption-cache.ts index 440c3fde8..26ab3bd0d 100644 --- a/server/lib/files-cache/videos-caption-cache.ts +++ b/server/lib/files-cache/videos-caption-cache.ts @@ -5,7 +5,7 @@ import { VideoCaptionModel } from '../../models/video/video-caption' import { AbstractVideoStaticFileCache } from './abstract-video-static-file-cache' import { CONFIG } from '../../initializers/config' import { logger } from '../../helpers/logger' -import { fetchRemoteVideoStaticFile } from '../activitypub' +import { doRequestAndSaveToFile } from '@server/helpers/requests' type GetPathParam = { videoId: string, language: string } @@ -46,11 +46,10 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache { const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId) if (!video) return undefined - // FIXME: use URL - const remoteStaticPath = videoCaption.getCaptionStaticPath() + const remoteUrl = videoCaption.getFileUrl(video) const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.getCaptionName()) - await fetchRemoteVideoStaticFile(video, remoteStaticPath, destPath) + await doRequestAndSaveToFile({ uri: remoteUrl }, destPath) return { isOwned: false, path: destPath } } -- cgit v1.2.3