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)
}
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 }
}
}