diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-24 10:25:56 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-24 10:25:56 +0100 |
commit | 1f7ab4f3104df051f2d2cd4ed85ff6092c92efeb (patch) | |
tree | 69e7d2617fcd26ff2015adfb3ddc072f40978191 /server/lib | |
parent | 95d5969445734ece19ad603a6d8cd20edf77cec9 (diff) | |
download | PeerTube-1f7ab4f3104df051f2d2cd4ed85ff6092c92efeb.tar.gz PeerTube-1f7ab4f3104df051f2d2cd4ed85ff6092c92efeb.tar.zst PeerTube-1f7ab4f3104df051f2d2cd4ed85ff6092c92efeb.zip |
Upgrade server dependencies
Diffstat (limited to 'server/lib')
4 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 442cd5c0b..eff796c1d 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -79,7 +79,7 @@ async function processCreateVideo ( | |||
79 | 79 | ||
80 | async function createRates (actorUrls: string[], video: VideoModel, rate: VideoRateType) { | 80 | async function createRates (actorUrls: string[], video: VideoModel, rate: VideoRateType) { |
81 | let rateCounts = 0 | 81 | let rateCounts = 0 |
82 | const tasks: Bluebird<any>[] = [] | 82 | const tasks: Bluebird<number>[] = [] |
83 | 83 | ||
84 | for (const actorUrl of actorUrls) { | 84 | for (const actorUrl of actorUrls) { |
85 | const actor = await getOrCreateActorAndServerAndModel(actorUrl) | 85 | const actor = await getOrCreateActorAndServerAndModel(actorUrl) |
diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts index 5439a47f2..b5c97e515 100644 --- a/server/lib/activitypub/process/process-update.ts +++ b/server/lib/activitypub/process/process-update.ts | |||
@@ -2,6 +2,7 @@ import * as Bluebird from 'bluebird' | |||
2 | import { ActivityUpdate } from '../../../../shared/models/activitypub' | 2 | import { ActivityUpdate } from '../../../../shared/models/activitypub' |
3 | import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor' | 3 | import { ActivityPubActor } from '../../../../shared/models/activitypub/activitypub-actor' |
4 | import { VideoTorrentObject } from '../../../../shared/models/activitypub/objects' | 4 | import { VideoTorrentObject } from '../../../../shared/models/activitypub/objects' |
5 | import { VideoFile } from '../../../../shared/models/videos' | ||
5 | import { retryTransactionWrapper } from '../../../helpers/database-utils' | 6 | import { retryTransactionWrapper } from '../../../helpers/database-utils' |
6 | import { logger } from '../../../helpers/logger' | 7 | import { logger } from '../../../helpers/logger' |
7 | import { resetSequelizeInstance } from '../../../helpers/utils' | 8 | import { resetSequelizeInstance } from '../../../helpers/utils' |
@@ -90,7 +91,7 @@ async function updateRemoteVideo (actor: ActorModel, activity: ActivityUpdate) { | |||
90 | await Promise.all(videoFileDestroyTasks) | 91 | await Promise.all(videoFileDestroyTasks) |
91 | 92 | ||
92 | const videoFileAttributes = videoFileActivityUrlToDBAttributes(videoInstance, videoAttributesToUpdate) | 93 | const videoFileAttributes = videoFileActivityUrlToDBAttributes(videoInstance, videoAttributesToUpdate) |
93 | const tasks: Bluebird<any>[] = videoFileAttributes.map(f => VideoFileModel.create(f)) | 94 | const tasks = videoFileAttributes.map(f => VideoFileModel.create(f)) |
94 | await Promise.all(tasks) | 95 | await Promise.all(tasks) |
95 | 96 | ||
96 | const tags = videoAttributesToUpdate.tag.map(t => t.name) | 97 | const tags = videoAttributesToUpdate.tag.map(t => t.name) |
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 1d2d46cbc..263c2629c 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts | |||
@@ -163,7 +163,7 @@ async function getOrCreateVideo (videoObject: VideoTorrentObject, channelActor: | |||
163 | throw new Error('Cannot find valid files for video %s ' + videoObject.url) | 163 | throw new Error('Cannot find valid files for video %s ' + videoObject.url) |
164 | } | 164 | } |
165 | 165 | ||
166 | const tasks: Bluebird<any>[] = videoFileAttributes.map(f => VideoFileModel.create(f, { transaction: t })) | 166 | const tasks = videoFileAttributes.map(f => VideoFileModel.create(f, { transaction: t })) |
167 | await Promise.all(tasks) | 167 | await Promise.all(tasks) |
168 | 168 | ||
169 | const tags = videoObject.tag.map(t => t.name) | 169 | const tags = videoObject.tag.map(t => t.name) |
diff --git a/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts b/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts index 23677e8d5..f224a31b4 100644 --- a/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts +++ b/server/lib/jobs/transcoding-job-scheduler/video-file-optimizer-handler.ts | |||
@@ -3,6 +3,7 @@ import { VideoPrivacy } from '../../../../shared/models/videos' | |||
3 | import { logger } from '../../../helpers/logger' | 3 | import { logger } from '../../../helpers/logger' |
4 | import { computeResolutionsToTranscode } from '../../../helpers/utils' | 4 | import { computeResolutionsToTranscode } from '../../../helpers/utils' |
5 | import { sequelizeTypescript } from '../../../initializers' | 5 | import { sequelizeTypescript } from '../../../initializers' |
6 | import { JobModel } from '../../../models/job/job' | ||
6 | import { VideoModel } from '../../../models/video/video' | 7 | import { VideoModel } from '../../../models/video/video' |
7 | import { shareVideoByServerAndChannel } from '../../activitypub' | 8 | import { shareVideoByServerAndChannel } from '../../activitypub' |
8 | import { sendCreateVideo } from '../../activitypub/send' | 9 | import { sendCreateVideo } from '../../activitypub/send' |
@@ -55,7 +56,7 @@ async function onSuccess (jobId: number, video: VideoModel, jobScheduler: JobSch | |||
55 | if (resolutionsEnabled.length !== 0) { | 56 | if (resolutionsEnabled.length !== 0) { |
56 | try { | 57 | try { |
57 | await sequelizeTypescript.transaction(async t => { | 58 | await sequelizeTypescript.transaction(async t => { |
58 | const tasks: Bluebird<any>[] = [] | 59 | const tasks: Bluebird<JobModel>[] = [] |
59 | 60 | ||
60 | for (const resolution of resolutionsEnabled) { | 61 | for (const resolution of resolutionsEnabled) { |
61 | const dataInput = { | 62 | const dataInput = { |