From 3acc50844047a37698f0618fa235c138e386a053 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Apr 2019 09:50:57 +0200 Subject: Upgrade sequelize --- server/lib/files-cache/videos-preview-cache.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/lib/files-cache/videos-preview-cache.ts') 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 { const video = await VideoModel.loadByUUIDWithFile(videoUUID) if (!video) return undefined - if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreview().filename) + if (video.isOwned()) return { isOwned: true, path: join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreview().filename) } return this.loadRemoteFile(videoUUID) } @@ -35,7 +35,9 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache { const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename) const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename) - return this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) + const path = await this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) + + return { isOwned: false, path } } } -- cgit v1.2.3