Fix video announces processing
[oweals/peertube.git] / server / lib / activitypub / videos.ts
index 7d535bb0acc2cc31325569cf364cd46e4467f36a..40e9318e3817cd0234d2e344783bd893a095acf5 100644 (file)
@@ -91,7 +91,7 @@ async function videoActivityObjectToDBAttributes (videoChannel: VideoChannelMode
     licence,
     language,
     description,
-    nsfw: videoObject.nsfw,
+    nsfw: videoObject.sensitive,
     commentsEnabled: videoObject.commentsEnabled,
     channelId: videoChannel.id,
     duration: parseInt(duration, 10),
@@ -279,11 +279,14 @@ async function addVideoShares (instance: VideoModel, shareUrls: string[]) {
 
     const entry = {
       actorId: actor.id,
-      videoId: instance.id
+      videoId: instance.id,
+      url: shareUrl
     }
 
     await VideoShareModel.findOrCreate({
-      where: entry,
+      where: {
+        url: shareUrl
+      },
       defaults: entry
     })
   }