X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fprocess%2Fprocess-create.ts;h=6b7f5aae8f57e96f23cdbe7c363266b62889668a;hb=49af5ac8c2653cb0ef23479c9d3256c5b724d49d;hp=9cded4dec00a28a7571ee3e1ce019d0b53a68a8a;hpb=403c69c5a34e6db621f30c7b2bfb2b80dc8e74c1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 9cded4dec..6b7f5aae8 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts @@ -1,3 +1,4 @@ +import { isBlockedByServerOrAccount } from '@server/lib/blocklist' import { isRedundancyAccepted } from '@server/lib/redundancy' import { ActivityCreate, CacheFileObject, VideoObject } from '../../../../shared' import { PlaylistObject } from '../../../../shared/models/activitypub/objects/playlist-object' @@ -9,11 +10,10 @@ import { APProcessorOptions } from '../../../types/activitypub-processor.model' import { MActorSignature, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../../types/models' import { Notifier } from '../../notifier' import { createOrUpdateCacheFile } from '../cache-file' -import { createOrUpdateVideoPlaylist } from '../playlist' +import { createOrUpdateVideoPlaylist } from '../playlists' import { forwardVideoRelatedActivity } from '../send/utils' import { resolveThread } from '../video-comments' -import { getOrCreateVideoAndAccountAndChannel } from '../videos' -import { isBlockedByServerOrAccount } from '@server/lib/blocklist' +import { getOrCreateAPVideo } from '../videos' async function processCreateActivity (options: APProcessorOptions) { const { activity, byActor } = options @@ -55,7 +55,7 @@ async function processCreateVideo (activity: ActivityCreate, notify: boolean) { const videoToCreateData = activity.object as VideoObject const syncParam = { likes: false, dislikes: false, shares: false, comments: false, thumbnail: true, refreshVideo: false } - const { video, created } = await getOrCreateVideoAndAccountAndChannel({ videoObject: videoToCreateData, syncParam }) + const { video, created } = await getOrCreateAPVideo({ videoObject: videoToCreateData, syncParam }) if (created && notify) Notifier.Instance.notifyOnNewVideoIfNeeded(video) @@ -67,7 +67,7 @@ async function processCreateCacheFile (activity: ActivityCreate, byActor: MActor const cacheFile = activity.object as CacheFileObject - const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFile.object }) + const { video } = await getOrCreateAPVideo({ videoObject: cacheFile.object }) await sequelizeTypescript.transaction(async t => { return createOrUpdateCacheFile(cacheFile, video, byActor, t)