diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-14 16:05:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-14 16:05:25 +0200 |
commit | a9fbc2aaa17ab74b38952f905c567c4fd2c9d9e8 (patch) | |
tree | 03a7baef63ccd1a7b2e05ca0239c589b0d7e4647 | |
parent | c5c848c50b603a506d8da74fa073cbf67e9edbb4 (diff) | |
download | PeerTube-a9fbc2aaa17ab74b38952f905c567c4fd2c9d9e8.tar.gz PeerTube-a9fbc2aaa17ab74b38952f905c567c4fd2c9d9e8.tar.zst PeerTube-a9fbc2aaa17ab74b38952f905c567c4fd2c9d9e8.zip |
Handle short video links
-rw-r--r-- | server/lib/activitypub/videos/get.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/server/lib/activitypub/videos/get.ts b/server/lib/activitypub/videos/get.ts index 5d1f92bba..f0982bd98 100644 --- a/server/lib/activitypub/videos/get.ts +++ b/server/lib/activitypub/videos/get.ts | |||
@@ -61,6 +61,8 @@ async function getOrCreateAPVideo ( | |||
61 | const { videoObject } = await fetchRemoteVideo(videoUrl) | 61 | const { videoObject } = await fetchRemoteVideo(videoUrl) |
62 | if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl) | 62 | if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl) |
63 | 63 | ||
64 | if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject }) | ||
65 | |||
64 | try { | 66 | try { |
65 | const creator = new APVideoCreator(videoObject) | 67 | const creator = new APVideoCreator(videoObject) |
66 | const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator), syncParam.thumbnail) | 68 | const { autoBlacklisted, videoCreated } = await retryTransactionWrapper(creator.create.bind(creator), syncParam.thumbnail) |