aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-11 19:16:00 +0200
committerChocobozzz <me@florianbigard.com>2018-06-11 19:16:00 +0200
commit6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (patch)
treefdbae8827da56dc9039925b090add90ce24a6e2c /server/models/video/video.ts
parent77540346413259e4ec62ee8302e503bcd2a01047 (diff)
downloadPeerTube-6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf.tar.gz
PeerTube-6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf.tar.zst
PeerTube-6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf.zip
Fix import with when the imported file has the same extension than an
already existing file
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts6
1 files changed, 3 insertions, 3 deletions
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<VideoModel> {
1325 videoId: this.id 1325 videoId: this.id
1326 }) 1326 })
1327 1327
1328 const outputPath = this.getVideoFilePath(updatedVideoFile)
1329 await copyFilePromise(inputFilePath, outputPath)
1330
1331 const currentVideoFile = this.VideoFiles.find(videoFile => videoFile.resolution === updatedVideoFile.resolution) 1328 const currentVideoFile = this.VideoFiles.find(videoFile => videoFile.resolution === updatedVideoFile.resolution)
1332 1329
1333 if (currentVideoFile) { 1330 if (currentVideoFile) {
@@ -1344,6 +1341,9 @@ export class VideoModel extends Model<VideoModel> {
1344 updatedVideoFile = currentVideoFile 1341 updatedVideoFile = currentVideoFile
1345 } 1342 }
1346 1343
1344 const outputPath = this.getVideoFilePath(updatedVideoFile)
1345 await copyFilePromise(inputFilePath, outputPath)
1346
1347 await this.createTorrentAndSetInfoHash(updatedVideoFile) 1347 await this.createTorrentAndSetInfoHash(updatedVideoFile)
1348 1348
1349 await updatedVideoFile.save() 1349 await updatedVideoFile.save()