]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/send/send-update.ts
Fix playlist more button with long video names
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / send / send-update.ts
index 3eb2704fd6882b544eb615ca4b6b559eb7ea84b5..5bf092894eba54a65b5d6548712f018f511b444b 100644 (file)
@@ -26,7 +26,9 @@ async function sendUpdateVideo (video: VideoModel, t: Transaction, overrodeByAct
   const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())
 
   // Needed to build the AP object
-  if (!video.VideoCaptions) video.VideoCaptions = await video.$get('VideoCaptions') as VideoCaptionModel[]
+  if (!video.VideoCaptions) {
+    video.VideoCaptions = await video.$get('VideoCaptions', { transaction: t }) as VideoCaptionModel[]
+  }
 
   const videoObject = video.toActivityPubObject()
   const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC)
@@ -52,7 +54,7 @@ async function sendUpdateActor (accountOrChannel: AccountModel | VideoChannelMod
   let actorsInvolved: ActorModel[]
   if (accountOrChannel instanceof AccountModel) {
     // Actors that shared my videos are involved too
-    actorsInvolved = await VideoShareModel.loadActorsByVideoOwner(byActor.id, t)
+    actorsInvolved = await VideoShareModel.loadActorsWhoSharedVideosOf(byActor.id, t)
   } else {
     // Actors that shared videos of my channel are involved too
     actorsInvolved = await VideoShareModel.loadActorsByVideoChannel(accountOrChannel.id, t)
@@ -87,7 +89,7 @@ async function sendUpdateVideoPlaylist (videoPlaylist: VideoPlaylistModel, t: Tr
 
   const url = getUpdateActivityPubUrl(videoPlaylist.url, videoPlaylist.updatedAt.toISOString())
 
-  const object = await videoPlaylist.toActivityPubObject()
+  const object = await videoPlaylist.toActivityPubObject(null, t)
   const audience = getAudience(byActor, videoPlaylist.privacy === VideoPlaylistPrivacy.PUBLIC)
 
   const updateActivity = buildUpdateActivity(url, byActor, object, audience)