getVideoSharesActivityPubUrl
} from '../../lib/activitypub'
import { VideoCaptionModel } from '../../models/video/video-caption'
-import { videoRedundancyGetValidator } from '../../middlewares/validators/redundancy'
+import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy'
import { getServerActor } from '../../helpers/utils'
import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
+ import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike'
const activityPubClientRouter = express.Router()
return broadcastToFollowers(createActivity, byActor, [ byActor ], t)
}
- async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel) {
- if (!video.VideoChannel.Account.Actor.serverId) return // Local
-
- const url = getVideoAbuseActivityPubUrl(videoAbuse)
-
- logger.info('Creating job to send video abuse %s.', url)
-
- // Custom audience, we only send the abuse to the origin instance
- const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] }
- const createActivity = buildCreateActivity(url, byActor, videoAbuse.toActivityPubObject(), audience)
-
- return unicastTo(createActivity, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl)
- }
-
-async function sendCreateCacheFile (byActor: ActorModel, fileRedundancy: VideoRedundancyModel) {
+async function sendCreateCacheFile (byActor: ActorModel, video: VideoModel, fileRedundancy: VideoRedundancyModel) {
logger.info('Creating job to send file cache of %s.', fileRedundancy.url)
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(fileRedundancy.VideoFile.Video.id)
- const redundancyObject = fileRedundancy.toActivityPubObject()
-
return sendVideoRelatedCreateActivity({
byActor,
video,