diff options
Diffstat (limited to 'server/lib/files-cache/videos-preview-cache.ts')
-rw-r--r-- | server/lib/files-cache/videos-preview-cache.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts index 6575e1c83..fc0d92c78 100644 --- a/server/lib/files-cache/videos-preview-cache.ts +++ b/server/lib/files-cache/videos-preview-cache.ts | |||
@@ -16,13 +16,13 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { | |||
16 | return this.instance || (this.instance = new this()) | 16 | return this.instance || (this.instance = new this()) |
17 | } | 17 | } |
18 | 18 | ||
19 | async getFilePath (videoUUID: string) { | 19 | async getFilePathImpl (videoUUID: string) { |
20 | const video = await VideoModel.loadByUUIDWithFile(videoUUID) | 20 | const video = await VideoModel.loadByUUIDWithFile(videoUUID) |
21 | if (!video) return undefined | 21 | if (!video) return undefined |
22 | 22 | ||
23 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName()) | 23 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreview().filename) |
24 | 24 | ||
25 | return this.loadFromLRU(videoUUID) | 25 | return this.loadRemoteFile(videoUUID) |
26 | } | 26 | } |
27 | 27 | ||
28 | protected async loadRemoteFile (key: string) { | 28 | protected async loadRemoteFile (key: string) { |
@@ -31,8 +31,9 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { | |||
31 | 31 | ||
32 | if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.') | 32 | if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.') |
33 | 33 | ||
34 | const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreviewName()) | 34 | // FIXME: use URL |
35 | const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreviewName()) | 35 | const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename) |
36 | const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename) | ||
36 | 37 | ||
37 | return this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) | 38 | return this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) |
38 | } | 39 | } |