Resolve object id from actors too

pull/4197/head
Chocobozzz 2021-06-16 10:01:31 +02:00
parent 82d19a2249
commit fd6584844b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,9 @@ async function getOrCreateAPActor (
const { actorObject } = await fetchRemoteActor(actorUrl) const { actorObject } = await fetchRemoteActor(actorUrl)
if (actorObject === undefined) throw new Error('Cannot fetch remote actor ' + actorUrl) if (actorObject === undefined) throw new Error('Cannot fetch remote actor ' + actorUrl)
// actorUrl is just an alias/rediraction, so process object id instead
if (actorObject.id !== actorUrl) return getOrCreateAPActor(actorObject, 'all', recurseIfNeeded, updateCollections)
// Create the attributed to actor // Create the attributed to actor
// In PeerTube a video channel is owned by an account // In PeerTube a video channel is owned by an account
let ownerActor: MActorFullActor let ownerActor: MActorFullActor

View File

@ -61,6 +61,7 @@ async function getOrCreateAPVideo (
const { videoObject } = await fetchRemoteVideo(videoUrl) const { videoObject } = await fetchRemoteVideo(videoUrl)
if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl) if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl)
// videoUrl is just an alias/rediraction, so process object id instead
if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject }) if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject })
try { try {