]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Handle short video links
authorChocobozzz <me@florianbigard.com>
Mon, 14 Jun 2021 14:05:25 +0000 (16:05 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 14 Jun 2021 14:05:25 +0000 (16:05 +0200)
server/lib/activitypub/videos/get.ts

index 5d1f92bba4d9b0d4d3811783b1f02d1b5552af6e..f0982bd98b822b65ae85c032c1d63151f44c4bef 100644 (file)
@@ -61,6 +61,8 @@ async function getOrCreateAPVideo (
   const { videoObject } = await fetchRemoteVideo(videoUrl)
   if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl)
 
+  if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject })
+
   try {
     const creator = new APVideoCreator(videoObject)
     const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator), syncParam.thumbnail)