diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-17 09:23:57 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-17 09:23:57 +0100 |
commit | 9cfeb3cf989fffccdfe3e575903dc00baab255b2 (patch) | |
tree | 8a40ade507ebb1ba874a2e934420c523d6853638 /server/lib/activitypub/send/send-update.ts | |
parent | 9e454eba570ca459a2dc2bb99ed6a700622e4f32 (diff) | |
download | PeerTube-9cfeb3cf989fffccdfe3e575903dc00baab255b2.tar.gz PeerTube-9cfeb3cf989fffccdfe3e575903dc00baab255b2.tar.zst PeerTube-9cfeb3cf989fffccdfe3e575903dc00baab255b2.zip |
Fix redundancy federation in some cases
Diffstat (limited to 'server/lib/activitypub/send/send-update.ts')
-rw-r--r-- | server/lib/activitypub/send/send-update.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts index 305edf429..bcf6e1569 100644 --- a/server/lib/activitypub/send/send-update.ts +++ b/server/lib/activitypub/send/send-update.ts | |||
@@ -75,7 +75,13 @@ async function sendUpdateActor (accountOrChannel: MChannelDefault | MAccountDefa | |||
75 | async function sendUpdateCacheFile (byActor: MActorLight, redundancyModel: MVideoRedundancyVideo) { | 75 | async function sendUpdateCacheFile (byActor: MActorLight, redundancyModel: MVideoRedundancyVideo) { |
76 | logger.info('Creating job to update cache file %s.', redundancyModel.url) | 76 | logger.info('Creating job to update cache file %s.', redundancyModel.url) |
77 | 77 | ||
78 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(redundancyModel.getVideo().id) | 78 | const associatedVideo = redundancyModel.getVideo() |
79 | if (!associatedVideo) { | ||
80 | logger.warn('Cannot send update activity for redundancy %s: no video files associated.', redundancyModel.url) | ||
81 | return | ||
82 | } | ||
83 | |||
84 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(associatedVideo.id) | ||
79 | 85 | ||
80 | const activityBuilder = (audience: ActivityAudience) => { | 86 | const activityBuilder = (audience: ActivityAudience) => { |
81 | const redundancyObject = redundancyModel.toActivityPubObject() | 87 | const redundancyObject = redundancyModel.toActivityPubObject() |