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)
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')