}
async getFilePath (videoUUID: string) {
- const video = await VideoModel.loadByUUID(videoUUID)
+ const video = await VideoModel.loadByUUIDWithFile(videoUUID)
if (!video) return undefined
if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName())
}
protected async loadRemoteFile (key: string) {
- const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(key)
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(key)
if (!video) return undefined
if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.')
const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreviewName())
- const destPath = join(CACHE.DIRECTORIES.PREVIEWS, video.getPreviewName())
+ const destPath = join(CACHE.PREVIEWS.DIRECTORY, video.getPreviewName())
return this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath)
}