]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-add.ts
Add activitypub migration script
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-add.ts
index 433e68eb6c8a6dadffc01284515e5ebb069fa5ae..98280b9f05fe490a9bcb1abdc1dd5c8cbc853ed0 100644 (file)
@@ -76,7 +76,7 @@ function addRemoteVideo (account: AccountInstance,
     if (videoChannel.Account.id !== account.id) throw new Error('Video channel is not owned by this account.')
 
     const videoFromDatabase = await db.Video.loadByUUIDOrURL(videoToCreateData.uuid, videoToCreateData.id, t)
-    if (videoFromDatabase) throw new Error('Video with this UUID/Url already exists.')
+    if (videoFromDatabase) return videoFromDatabase
 
     const videoData = await videoActivityObjectToDBAttributes(videoChannel, videoToCreateData, activity.to, activity.cc)
     const video = db.Video.build(videoData)