Try to fix video duplication
authorChocobozzz <me@florianbigard.com>
Thu, 22 Aug 2019 09:03:50 +0000 (11:03 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 22 Aug 2019 09:03:50 +0000 (11:03 +0200)
server/lib/schedulers/videos-redundancy-scheduler.ts

index 04f601bfb9266f8cd2ec693c38d813e75495737f..cd70fd85161273cdb3acbada1022d79e643e9831 100644 (file)
@@ -185,7 +185,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
     const tmpPath = await downloadWebTorrentVideo({ magnetUri }, VIDEO_IMPORT_TIMEOUT)
 
     const destPath = join(CONFIG.STORAGE.REDUNDANCY_DIR, video.getVideoFilename(file))
-    await move(tmpPath, destPath)
+    await move(tmpPath, destPath, { overwrite: true })
 
     const createdModel = await VideoRedundancyModel.create({
       expiresOn: this.buildNewExpiration(redundancy.minLifetime),