X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fvideos.ts;h=4cecf9345912a6d08eb59b73d13a6de183b20036;hb=361805c48b14c5402c9984485c67c45a1a3113cc;hp=6ff9baefe37bffaf6f94f99bff836a9c96d34ac6;hpb=a8a63227781c6815532cb7a68699b08fdb0368be;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 6ff9baefe..4cecf9345 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -29,7 +29,7 @@ import { createRates } from './video-rates' import { addVideoShares, shareVideoByServerAndChannel } from './share' import { AccountModel } from '../../models/account/account' import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video' -import { checkUrlsSameHost } from '../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) { // If the video is not private and published, we federate it @@ -167,7 +167,7 @@ async function getOrCreateVideoAndAccountAndChannel (options: { const refreshViews = options.refreshViews || false // Get video url - const videoUrl = typeof options.videoObject === 'string' ? options.videoObject : options.videoObject.id + const videoUrl = getAPUrl(options.videoObject) let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType) if (videoFromDatabase) {