aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/videos-caption-cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/files-cache/videos-caption-cache.ts')
-rw-r--r--server/lib/files-cache/videos-caption-cache.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/files-cache/videos-caption-cache.ts b/server/lib/files-cache/videos-caption-cache.ts
index 0926f4009..d4a0a3345 100644
--- a/server/lib/files-cache/videos-caption-cache.ts
+++ b/server/lib/files-cache/videos-caption-cache.ts
@@ -20,14 +20,14 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <GetPathParam> {
20 return this.instance || (this.instance = new this()) 20 return this.instance || (this.instance = new this())
21 } 21 }
22 22
23 async getFilePath (params: GetPathParam) { 23 async getFilePathImpl (params: GetPathParam) {
24 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(params.videoId, params.language) 24 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(params.videoId, params.language)
25 if (!videoCaption) return undefined 25 if (!videoCaption) return undefined
26 26
27 if (videoCaption.isOwned()) return join(CONFIG.STORAGE.CAPTIONS_DIR, videoCaption.getCaptionName()) 27 if (videoCaption.isOwned()) return join(CONFIG.STORAGE.CAPTIONS_DIR, videoCaption.getCaptionName())
28 28
29 const key = params.videoId + VideosCaptionCache.KEY_DELIMITER + params.language 29 const key = params.videoId + VideosCaptionCache.KEY_DELIMITER + params.language
30 return this.loadFromLRU(key) 30 return this.loadRemoteFile(key)
31 } 31 }
32 32
33 protected async loadRemoteFile (key: string) { 33 protected async loadRemoteFile (key: string) {
@@ -42,6 +42,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <GetPathParam> {
42 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId) 42 const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
43 if (!video) return undefined 43 if (!video) return undefined
44 44
45 // FIXME: use URL
45 const remoteStaticPath = videoCaption.getCaptionStaticPath() 46 const remoteStaticPath = videoCaption.getCaptionStaticPath()
46 const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.getCaptionName()) 47 const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.getCaptionName())
47 48