]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/files-cache/videos-caption-cache.ts
Create a dedicated table to track video thumbnails
[github/Chocobozzz/PeerTube.git] / server / lib / files-cache / videos-caption-cache.ts
index 0926f400952a37e6738191621de7d9224372de2c..d4a0a33450ed37c4f5e5fea38574b9cb226a6aa1 100644 (file)
@@ -20,14 +20,14 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <GetPathParam> {
     return this.instance || (this.instance = new this())
   }
 
-  async getFilePath (params: GetPathParam) {
+  async getFilePathImpl (params: GetPathParam) {
     const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(params.videoId, params.language)
     if (!videoCaption) return undefined
 
     if (videoCaption.isOwned()) return join(CONFIG.STORAGE.CAPTIONS_DIR, videoCaption.getCaptionName())
 
     const key = params.videoId + VideosCaptionCache.KEY_DELIMITER + params.language
-    return this.loadFromLRU(key)
+    return this.loadRemoteFile(key)
   }
 
   protected async loadRemoteFile (key: string) {
@@ -42,6 +42,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <GetPathParam> {
     const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
     if (!video) return undefined
 
+    // FIXME: use URL
     const remoteStaticPath = videoCaption.getCaptionStaticPath()
     const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.getCaptionName())