-
-async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) {
- // If the video is not private and is published, we federate it
- if (video.privacy !== VideoPrivacy.PRIVATE && video.state === VideoState.PUBLISHED) {
+import { ActorFollowScoreCache } from '../files-cache'
+import {
+ MAccountIdActor,
+ MChannelAccountLight,
+ MChannelDefault,
+ MChannelId,
+ MVideo,
+ MVideoAccountLight,
+ MVideoAccountLightBlacklistAllFiles,
+ MVideoAP,
+ MVideoAPWithoutCaption,
+ MVideoFile,
+ MVideoFullLight,
+ MVideoId,
+ MVideoThumbnail
+} from '../../typings/models'
+import { MThumbnail } from '../../typings/models/video/thumbnail'
+
+async function federateVideoIfNeeded (videoArg: MVideoAPWithoutCaption, isNewVideo: boolean, transaction?: sequelize.Transaction) {
+ const video = videoArg as MVideoAP
+
+ if (
+ // Check this is not a blacklisted video, or unfederated blacklisted video
+ (video.isBlacklisted() === false || (isNewVideo === false && video.VideoBlacklist.unfederated === false)) &&
+ // Check the video is public/unlisted and published
+ video.privacy !== VideoPrivacy.PRIVATE && video.state === VideoState.PUBLISHED
+ ) {