aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/videos-preview-cache.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/files-cache/videos-preview-cache.ts')
-rw-r--r--server/lib/files-cache/videos-preview-cache.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts
index fc0d92c78..c117ae426 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 <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.getPreview().filename) 23 if (video.isOwned()) return { isOwned: true, path: join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreview().filename) }
24 24
25 return this.loadRemoteFile(videoUUID) 25 return this.loadRemoteFile(videoUUID)
26 } 26 }
@@ -35,7 +35,9 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> {
35 const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename) 35 const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename)
36 const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename) 36 const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename)
37 37
38 return this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) 38 const path = await this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath)
39
40 return { isOwned: false, path }
39 } 41 }
40} 42}
41 43