From 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Jun 2018 19:16:00 +0200 Subject: Fix import with when the imported file has the same extension than an already existing file --- server/models/video/video.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/models') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index faa6f3f9b..1cb1e6798 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1325,9 +1325,6 @@ export class VideoModel extends Model { videoId: this.id }) - const outputPath = this.getVideoFilePath(updatedVideoFile) - await copyFilePromise(inputFilePath, outputPath) - const currentVideoFile = this.VideoFiles.find(videoFile => videoFile.resolution === updatedVideoFile.resolution) if (currentVideoFile) { @@ -1344,6 +1341,9 @@ export class VideoModel extends Model { updatedVideoFile = currentVideoFile } + const outputPath = this.getVideoFilePath(updatedVideoFile) + await copyFilePromise(inputFilePath, outputPath) + await this.createTorrentAndSetInfoHash(updatedVideoFile) await updatedVideoFile.save() -- cgit v1.2.3