]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-create.ts
Add context on activitypub responses
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-create.ts
index 08d61996a2ff7bac2bfe08cb689b8b037f33c158..eff796c1d219c5c0babc9ea1e7aa755f5d4f5bcf 100644 (file)
@@ -79,7 +79,7 @@ async function processCreateVideo (
 
 async function createRates (actorUrls: string[], video: VideoModel, rate: VideoRateType) {
   let rateCounts = 0
-  const tasks: Bluebird<any>[] = []
+  const tasks: Bluebird<number>[] = []
 
   for (const actorUrl of actorUrls) {
     const actor = await getOrCreateActorAndServerAndModel(actorUrl)
@@ -147,8 +147,8 @@ async function processCreateView (byActor: ActorModel, activity: ActivityCreate)
 
   const { video } = await getOrCreateAccountAndVideoAndChannel(view.object)
 
-  const account = await ActorModel.loadByUrl(view.actor)
-  if (!account) throw new Error('Unknown account ' + view.actor)
+  const actor = await ActorModel.loadByUrl(view.actor)
+  if (!actor) throw new Error('Unknown actor ' + view.actor)
 
   await video.increment('views')