aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/videos-preview-cache.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-23 09:50:57 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:21 +0200
commit3acc50844047a37698f0618fa235c138e386a053 (patch)
treee33243bf7fadbcf2df616fc41814245094fd881a /server/lib/files-cache/videos-preview-cache.ts
parent1735c825726edaa0af5035cb6cbb0cc0db502c6d (diff)
downloadPeerTube-3acc50844047a37698f0618fa235c138e386a053.tar.gz
PeerTube-3acc50844047a37698f0618fa235c138e386a053.tar.zst
PeerTube-3acc50844047a37698f0618fa235c138e386a053.zip
Upgrade sequelize
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