diff options
Diffstat (limited to 'server')
36 files changed, 54 insertions, 56 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 46e80d56d..7761ba602 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts | |||
@@ -226,7 +226,7 @@ async function registerUser (req: express.Request, res: express.Response) { | |||
226 | }) | 226 | }) |
227 | 227 | ||
228 | const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ | 228 | const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ |
229 | userToCreate: userToCreate, | 229 | userToCreate, |
230 | userDisplayName: body.displayName || undefined, | 230 | userDisplayName: body.displayName || undefined, |
231 | channelNames: body.channel | 231 | channelNames: body.channel |
232 | }) | 232 | }) |
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 44283e266..7576e77e7 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -274,7 +274,7 @@ async function buildVideo (channelId: number, body: VideoImportCreate, importDat | |||
274 | support: body.support || null, | 274 | support: body.support || null, |
275 | privacy: body.privacy || VideoPrivacy.PRIVATE, | 275 | privacy: body.privacy || VideoPrivacy.PRIVATE, |
276 | duration: 0, // duration will be set by the import job | 276 | duration: 0, // duration will be set by the import job |
277 | channelId: channelId, | 277 | channelId, |
278 | originallyPublishedAt: body.originallyPublishedAt | 278 | originallyPublishedAt: body.originallyPublishedAt |
279 | ? new Date(body.originallyPublishedAt) | 279 | ? new Date(body.originallyPublishedAt) |
280 | : importData.originallyPublishedAt | 280 | : importData.originallyPublishedAt |
diff --git a/server/controllers/api/videos/view.ts b/server/controllers/api/videos/view.ts index dee1ec67c..a747fa334 100644 --- a/server/controllers/api/videos/view.ts +++ b/server/controllers/api/videos/view.ts | |||
@@ -39,7 +39,7 @@ async function viewVideo (req: express.Request, res: express.Response) { | |||
39 | }) | 39 | }) |
40 | 40 | ||
41 | if (successView) { | 41 | if (successView) { |
42 | Hooks.runAction('action:api.video.viewed', { video: video, ip, req, res }) | 42 | Hooks.runAction('action:api.video.viewed', { video, ip, req, res }) |
43 | } | 43 | } |
44 | 44 | ||
45 | await updateUserHistoryIfNeeded(body, video, res) | 45 | await updateUserHistoryIfNeeded(body, video, res) |
diff --git a/server/controllers/services.ts b/server/controllers/services.ts index 70d08ab69..cabcbc00b 100644 --- a/server/controllers/services.ts +++ b/server/controllers/services.ts | |||
@@ -141,7 +141,7 @@ function buildOEmbed (options: { | |||
141 | html, | 141 | html, |
142 | width: embedWidth, | 142 | width: embedWidth, |
143 | height: embedHeight, | 143 | height: embedHeight, |
144 | title: title, | 144 | title, |
145 | author_name: channel.name, | 145 | author_name: channel.name, |
146 | author_url: channel.Actor.url, | 146 | author_url: channel.Actor.url, |
147 | provider_name: 'PeerTube', | 147 | provider_name: 'PeerTube', |
diff --git a/server/lib/activitypub/actors/shared/url-to-object.ts b/server/lib/activitypub/actors/shared/url-to-object.ts index 7bc37f1ff..12a121725 100644 --- a/server/lib/activitypub/actors/shared/url-to-object.ts +++ b/server/lib/activitypub/actors/shared/url-to-object.ts | |||
@@ -11,12 +11,12 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode: number | |||
11 | 11 | ||
12 | if (sanitizeAndCheckActorObject(body) === false) { | 12 | if (sanitizeAndCheckActorObject(body) === false) { |
13 | logger.debug('Remote actor JSON is not valid.', { actorJSON: body }) | 13 | logger.debug('Remote actor JSON is not valid.', { actorJSON: body }) |
14 | return { actorObject: undefined, statusCode: statusCode } | 14 | return { actorObject: undefined, statusCode } |
15 | } | 15 | } |
16 | 16 | ||
17 | if (checkUrlsSameHost(body.id, actorUrl) !== true) { | 17 | if (checkUrlsSameHost(body.id, actorUrl) !== true) { |
18 | logger.warn('Actor url %s has not the same host than its AP id %s', actorUrl, body.id) | 18 | logger.warn('Actor url %s has not the same host than its AP id %s', actorUrl, body.id) |
19 | return { actorObject: undefined, statusCode: statusCode } | 19 | return { actorObject: undefined, statusCode } |
20 | } | 20 | } |
21 | 21 | ||
22 | return { | 22 | return { |
diff --git a/server/lib/auth/external-auth.ts b/server/lib/auth/external-auth.ts index 80f5064b6..053112801 100644 --- a/server/lib/auth/external-auth.ts +++ b/server/lib/auth/external-auth.ts | |||
@@ -166,7 +166,7 @@ function getBypassFromExternalAuth (username: string, externalAuthToken: string) | |||
166 | return { | 166 | return { |
167 | bypass: true, | 167 | bypass: true, |
168 | pluginName: npmName, | 168 | pluginName: npmName, |
169 | authName: authName, | 169 | authName, |
170 | user | 170 | user |
171 | } | 171 | } |
172 | } | 172 | } |
diff --git a/server/lib/blocklist.ts b/server/lib/blocklist.ts index 98273a6ea..a11b717b5 100644 --- a/server/lib/blocklist.ts +++ b/server/lib/blocklist.ts | |||
@@ -8,7 +8,7 @@ function addAccountInBlocklist (byAccountId: number, targetAccountId: number) { | |||
8 | return sequelizeTypescript.transaction(async t => { | 8 | return sequelizeTypescript.transaction(async t => { |
9 | return AccountBlocklistModel.upsert({ | 9 | return AccountBlocklistModel.upsert({ |
10 | accountId: byAccountId, | 10 | accountId: byAccountId, |
11 | targetAccountId: targetAccountId | 11 | targetAccountId |
12 | }, { transaction: t }) | 12 | }, { transaction: t }) |
13 | }) | 13 | }) |
14 | } | 14 | } |
diff --git a/server/lib/moderation.ts b/server/lib/moderation.ts index c2565f867..c23f5b6a6 100644 --- a/server/lib/moderation.ts +++ b/server/lib/moderation.ts | |||
@@ -115,8 +115,8 @@ async function createVideoAbuse (options: { | |||
115 | const videoAbuseInstance: MVideoAbuseVideoFull = await VideoAbuseModel.create({ | 115 | const videoAbuseInstance: MVideoAbuseVideoFull = await VideoAbuseModel.create({ |
116 | abuseId: abuseInstance.id, | 116 | abuseId: abuseInstance.id, |
117 | videoId: videoInstance.id, | 117 | videoId: videoInstance.id, |
118 | startAt: startAt, | 118 | startAt, |
119 | endAt: endAt | 119 | endAt |
120 | }, { transaction }) | 120 | }, { transaction }) |
121 | 121 | ||
122 | videoAbuseInstance.Video = videoInstance | 122 | videoAbuseInstance.Video = videoInstance |
diff --git a/server/lib/opentelemetry/tracing.ts b/server/lib/opentelemetry/tracing.ts index 5358d04de..23764e9e4 100644 --- a/server/lib/opentelemetry/tracing.ts +++ b/server/lib/opentelemetry/tracing.ts | |||
@@ -47,7 +47,7 @@ function registerOpentelemetryTracing () { | |||
47 | }) | 47 | }) |
48 | 48 | ||
49 | registerInstrumentations({ | 49 | registerInstrumentations({ |
50 | tracerProvider: tracerProvider, | 50 | tracerProvider, |
51 | instrumentations: [ | 51 | instrumentations: [ |
52 | new PgInstrumentation({ | 52 | new PgInstrumentation({ |
53 | enhancedDatabaseReporting: true | 53 | enhancedDatabaseReporting: true |
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts index 1305f660f..c21ebd0c5 100644 --- a/server/lib/plugins/plugin-manager.ts +++ b/server/lib/plugins/plugin-manager.ts | |||
@@ -563,7 +563,7 @@ export class PluginManager implements ServerHook { | |||
563 | if (!this.hooks[options.target]) this.hooks[options.target] = [] | 563 | if (!this.hooks[options.target]) this.hooks[options.target] = [] |
564 | 564 | ||
565 | this.hooks[options.target].push({ | 565 | this.hooks[options.target].push({ |
566 | npmName: npmName, | 566 | npmName, |
567 | pluginName: plugin.name, | 567 | pluginName: plugin.name, |
568 | handler: options.handler, | 568 | handler: options.handler, |
569 | priority: options.priority || 0 | 569 | priority: options.priority || 0 |
diff --git a/server/lib/plugins/video-constant-manager-factory.ts b/server/lib/plugins/video-constant-manager-factory.ts index f04dde29f..5f7edfbe2 100644 --- a/server/lib/plugins/video-constant-manager-factory.ts +++ b/server/lib/plugins/video-constant-manager-factory.ts | |||
@@ -97,7 +97,7 @@ export class VideoConstantManagerFactory { | |||
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | this.updatedVideoConstants[type][npmName].added.push({ key: key, label } as VideoConstant) | 100 | this.updatedVideoConstants[type][npmName].added.push({ key, label } as VideoConstant) |
101 | obj[key] = label | 101 | obj[key] = label |
102 | 102 | ||
103 | return true | 103 | return true |
diff --git a/server/lib/user.ts b/server/lib/user.ts index 586fd0f12..f4ffae0e4 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -64,8 +64,8 @@ function buildUser (options: { | |||
64 | emailVerified, | 64 | emailVerified, |
65 | adminFlags, | 65 | adminFlags, |
66 | 66 | ||
67 | videoQuota: videoQuota, | 67 | videoQuota, |
68 | videoQuotaDaily: videoQuotaDaily, | 68 | videoQuotaDaily, |
69 | 69 | ||
70 | pluginAuth | 70 | pluginAuth |
71 | }) | 71 | }) |
@@ -147,7 +147,7 @@ async function createApplicationActor (applicationId: number) { | |||
147 | const accountCreated = await createLocalAccountWithoutKeys({ | 147 | const accountCreated = await createLocalAccountWithoutKeys({ |
148 | name: SERVER_ACTOR_NAME, | 148 | name: SERVER_ACTOR_NAME, |
149 | userId: null, | 149 | userId: null, |
150 | applicationId: applicationId, | 150 | applicationId, |
151 | t: undefined, | 151 | t: undefined, |
152 | type: 'Application' | 152 | type: 'Application' |
153 | }) | 153 | }) |
diff --git a/server/lib/video.ts b/server/lib/video.ts index 86718abbe..b843b11bc 100644 --- a/server/lib/video.ts +++ b/server/lib/video.ts | |||
@@ -26,7 +26,7 @@ function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): Fil | |||
26 | description: videoInfo.description, | 26 | description: videoInfo.description, |
27 | support: videoInfo.support, | 27 | support: videoInfo.support, |
28 | privacy: videoInfo.privacy || VideoPrivacy.PRIVATE, | 28 | privacy: videoInfo.privacy || VideoPrivacy.PRIVATE, |
29 | channelId: channelId, | 29 | channelId, |
30 | originallyPublishedAt: videoInfo.originallyPublishedAt | 30 | originallyPublishedAt: videoInfo.originallyPublishedAt |
31 | ? new Date(videoInfo.originallyPublishedAt) | 31 | ? new Date(videoInfo.originallyPublishedAt) |
32 | : null | 32 | : null |
@@ -122,7 +122,7 @@ async function addOptimizeOrMergeAudioJob (options: { | |||
122 | async function addTranscodingJob (payload: VideoTranscodingPayload, options: CreateJobOptions = {}) { | 122 | async function addTranscodingJob (payload: VideoTranscodingPayload, options: CreateJobOptions = {}) { |
123 | await VideoJobInfoModel.increaseOrCreate(payload.videoUUID, 'pendingTranscode') | 123 | await VideoJobInfoModel.increaseOrCreate(payload.videoUUID, 'pendingTranscode') |
124 | 124 | ||
125 | return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload: payload }, options) | 125 | return JobQueue.Instance.createJobWithPromise({ type: 'video-transcoding', payload }, options) |
126 | } | 126 | } |
127 | 127 | ||
128 | async function getTranscodingJobPriority (user: MUserId) { | 128 | async function getTranscodingJobPriority (user: MUserId) { |
diff --git a/server/models/actor/actor-follow.ts b/server/models/actor/actor-follow.ts index af1d85e9f..8870bec05 100644 --- a/server/models/actor/actor-follow.ts +++ b/server/models/actor/actor-follow.ts | |||
@@ -218,7 +218,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo | |||
218 | const query = { | 218 | const query = { |
219 | where: { | 219 | where: { |
220 | actorId, | 220 | actorId, |
221 | targetActorId: targetActorId | 221 | targetActorId |
222 | }, | 222 | }, |
223 | include: [ | 223 | include: [ |
224 | { | 224 | { |
@@ -372,7 +372,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo | |||
372 | }) { | 372 | }) { |
373 | const { actorId, start, count, sort } = options | 373 | const { actorId, start, count, sort } = options |
374 | const where = { | 374 | const where = { |
375 | actorId: actorId | 375 | actorId |
376 | } | 376 | } |
377 | 377 | ||
378 | if (options.search) { | 378 | if (options.search) { |
diff --git a/server/models/oauth/oauth-client.ts b/server/models/oauth/oauth-client.ts index 860fa6f53..457e84613 100644 --- a/server/models/oauth/oauth-client.ts +++ b/server/models/oauth/oauth-client.ts | |||
@@ -53,8 +53,8 @@ export class OAuthClientModel extends Model<Partial<AttributesOnly<OAuthClientMo | |||
53 | static getByIdAndSecret (clientId: string, clientSecret: string) { | 53 | static getByIdAndSecret (clientId: string, clientSecret: string) { |
54 | const query = { | 54 | const query = { |
55 | where: { | 55 | where: { |
56 | clientId: clientId, | 56 | clientId, |
57 | clientSecret: clientSecret | 57 | clientSecret |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 6f84747da..b363afb28 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts | |||
@@ -530,7 +530,7 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoRedu | |||
530 | } | 530 | } |
531 | 531 | ||
532 | if (strategy) { | 532 | if (strategy) { |
533 | Object.assign(redundancyWhere, { strategy: strategy }) | 533 | Object.assign(redundancyWhere, { strategy }) |
534 | } | 534 | } |
535 | 535 | ||
536 | const videoFilterWhere = { | 536 | const videoFilterWhere = { |
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index dc260e512..3fd359359 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -488,9 +488,7 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> { | |||
488 | } | 488 | } |
489 | 489 | ||
490 | if (blocked !== undefined) { | 490 | if (blocked !== undefined) { |
491 | Object.assign(where, { | 491 | Object.assign(where, { blocked }) |
492 | blocked: blocked | ||
493 | }) | ||
494 | } | 492 | } |
495 | 493 | ||
496 | const query: FindOptions = { | 494 | const query: FindOptions = { |
diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index 00cca0549..81ce3dc9e 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts | |||
@@ -423,7 +423,7 @@ export class VideoPlaylistModel extends Model<Partial<AttributesOnly<VideoPlayli | |||
423 | ]).then(([ count, rows ]) => ({ total: count, data: rows })) | 423 | ]).then(([ count, rows ]) => ({ total: count, data: rows })) |
424 | } | 424 | } |
425 | 425 | ||
426 | static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search'| 'host'| 'uuids'> & { | 426 | static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search' | 'host' | 'uuids'> & { |
427 | start: number | 427 | start: number |
428 | count: number | 428 | count: number |
429 | sort: string | 429 | sort: string |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index cdc1137be..53328d311 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -949,7 +949,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
949 | const total = totalVideos + totalVideoShares | 949 | const total = totalVideos + totalVideoShares |
950 | return { | 950 | return { |
951 | data: rows, | 951 | data: rows, |
952 | total: total | 952 | total |
953 | } | 953 | } |
954 | }) | 954 | }) |
955 | } | 955 | } |
diff --git a/server/tests/api/check-params/abuses.ts b/server/tests/api/check-params/abuses.ts index bc2cc640f..7d8347412 100644 --- a/server/tests/api/check-params/abuses.ts +++ b/server/tests/api/check-params/abuses.ts | |||
@@ -163,7 +163,7 @@ describe('Test abuses API validators', function () { | |||
163 | 163 | ||
164 | it('Should fail with a wrong video', async function () { | 164 | it('Should fail with a wrong video', async function () { |
165 | const fields = { video: { id: 'blabla' }, reason: 'my super reason' } | 165 | const fields = { video: { id: 'blabla' }, reason: 'my super reason' } |
166 | await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) | 166 | await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) |
167 | }) | 167 | }) |
168 | 168 | ||
169 | it('Should fail with an unknown video', async function () { | 169 | it('Should fail with an unknown video', async function () { |
@@ -179,7 +179,7 @@ describe('Test abuses API validators', function () { | |||
179 | 179 | ||
180 | it('Should fail with a wrong comment', async function () { | 180 | it('Should fail with a wrong comment', async function () { |
181 | const fields = { comment: { id: 'blabla' }, reason: 'my super reason' } | 181 | const fields = { comment: { id: 'blabla' }, reason: 'my super reason' } |
182 | await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) | 182 | await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) |
183 | }) | 183 | }) |
184 | 184 | ||
185 | it('Should fail with an unknown comment', async function () { | 185 | it('Should fail with an unknown comment', async function () { |
@@ -195,7 +195,7 @@ describe('Test abuses API validators', function () { | |||
195 | 195 | ||
196 | it('Should fail with a wrong account', async function () { | 196 | it('Should fail with a wrong account', async function () { |
197 | const fields = { account: { id: 'blabla' }, reason: 'my super reason' } | 197 | const fields = { account: { id: 'blabla' }, reason: 'my super reason' } |
198 | await makePostBodyRequest({ url: server.url, path: path, token: userToken, fields }) | 198 | await makePostBodyRequest({ url: server.url, path, token: userToken, fields }) |
199 | }) | 199 | }) |
200 | 200 | ||
201 | it('Should fail with an unknown account', async function () { | 201 | it('Should fail with an unknown account', async function () { |
diff --git a/server/tests/api/check-params/live.ts b/server/tests/api/check-params/live.ts index 29f847e51..b092f16f9 100644 --- a/server/tests/api/check-params/live.ts +++ b/server/tests/api/check-params/live.ts | |||
@@ -51,7 +51,7 @@ describe('Test video lives API validator', function () { | |||
51 | 51 | ||
52 | const username = 'user1' | 52 | const username = 'user1' |
53 | const password = 'my super password' | 53 | const password = 'my super password' |
54 | await server.users.create({ username: username, password: password }) | 54 | await server.users.create({ username, password }) |
55 | userAccessToken = await server.login.getAccessToken({ username, password }) | 55 | userAccessToken = await server.login.getAccessToken({ username, password }) |
56 | 56 | ||
57 | { | 57 | { |
diff --git a/server/tests/api/check-params/users-admin.ts b/server/tests/api/check-params/users-admin.ts index d8353f83b..716c22556 100644 --- a/server/tests/api/check-params/users-admin.ts +++ b/server/tests/api/check-params/users-admin.ts | |||
@@ -175,7 +175,7 @@ describe('Test users admin API validators', function () { | |||
175 | 175 | ||
176 | await makePostBodyRequest({ | 176 | await makePostBodyRequest({ |
177 | url: server.url, | 177 | url: server.url, |
178 | path: path, | 178 | path, |
179 | token: server.accessToken, | 179 | token: server.accessToken, |
180 | fields, | 180 | fields, |
181 | expectedStatus: HttpStatusCode.OK_200 | 181 | expectedStatus: HttpStatusCode.OK_200 |
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 84254945c..4c4f54958 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts | |||
@@ -163,7 +163,7 @@ describe('Test users API validators', function () { | |||
163 | url: server.url, | 163 | url: server.url, |
164 | path: registrationPath, | 164 | path: registrationPath, |
165 | token: server.accessToken, | 165 | token: server.accessToken, |
166 | fields: fields, | 166 | fields, |
167 | expectedStatus: HttpStatusCode.NO_CONTENT_204 | 167 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
168 | }) | 168 | }) |
169 | }) | 169 | }) |
diff --git a/server/tests/api/check-params/video-blacklist.ts b/server/tests/api/check-params/video-blacklist.ts index 1aab60826..0ec3f49d5 100644 --- a/server/tests/api/check-params/video-blacklist.ts +++ b/server/tests/api/check-params/video-blacklist.ts | |||
@@ -37,14 +37,14 @@ describe('Test video blacklist API validators', function () { | |||
37 | { | 37 | { |
38 | const username = 'user1' | 38 | const username = 'user1' |
39 | const password = 'my super password' | 39 | const password = 'my super password' |
40 | await servers[0].users.create({ username: username, password: password }) | 40 | await servers[0].users.create({ username, password }) |
41 | userAccessToken1 = await servers[0].login.getAccessToken({ username, password }) | 41 | userAccessToken1 = await servers[0].login.getAccessToken({ username, password }) |
42 | } | 42 | } |
43 | 43 | ||
44 | { | 44 | { |
45 | const username = 'user2' | 45 | const username = 'user2' |
46 | const password = 'my super password' | 46 | const password = 'my super password' |
47 | await servers[0].users.create({ username: username, password: password }) | 47 | await servers[0].users.create({ username, password }) |
48 | userAccessToken2 = await servers[0].login.getAccessToken({ username, password }) | 48 | userAccessToken2 = await servers[0].login.getAccessToken({ username, password }) |
49 | } | 49 | } |
50 | 50 | ||
diff --git a/server/tests/api/check-params/video-imports.ts b/server/tests/api/check-params/video-imports.ts index da9d0826a..4439810e8 100644 --- a/server/tests/api/check-params/video-imports.ts +++ b/server/tests/api/check-params/video-imports.ts | |||
@@ -35,7 +35,7 @@ describe('Test video imports API validator', function () { | |||
35 | 35 | ||
36 | const username = 'user1' | 36 | const username = 'user1' |
37 | const password = 'my super password' | 37 | const password = 'my super password' |
38 | await server.users.create({ username: username, password: password }) | 38 | await server.users.create({ username, password }) |
39 | userAccessToken = await server.login.getAccessToken({ username, password }) | 39 | userAccessToken = await server.login.getAccessToken({ username, password }) |
40 | 40 | ||
41 | { | 41 | { |
diff --git a/server/tests/api/check-params/video-playlists.ts b/server/tests/api/check-params/video-playlists.ts index 4b17ce7db..8db91a3f9 100644 --- a/server/tests/api/check-params/video-playlists.ts +++ b/server/tests/api/check-params/video-playlists.ts | |||
@@ -209,7 +209,7 @@ describe('Test video playlists API validator', function () { | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | const getUpdate = (params: any, playlistId: number | string) => { | 211 | const getUpdate = (params: any, playlistId: number | string) => { |
212 | return { ...params, playlistId: playlistId } | 212 | return { ...params, playlistId } |
213 | } | 213 | } |
214 | 214 | ||
215 | it('Should fail with an unauthenticated user', async function () { | 215 | it('Should fail with an unauthenticated user', async function () { |
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 5ff51d1ff..e5c9b90c4 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -205,7 +205,7 @@ describe('Test videos API validator', function () { | |||
205 | support: 'my super support text', | 205 | support: 'my super support text', |
206 | tags: [ 'tag1', 'tag2' ], | 206 | tags: [ 'tag1', 'tag2' ], |
207 | privacy: VideoPrivacy.PUBLIC, | 207 | privacy: VideoPrivacy.PUBLIC, |
208 | channelId: channelId, | 208 | channelId, |
209 | originallyPublishedAt: new Date().toISOString() | 209 | originallyPublishedAt: new Date().toISOString() |
210 | } | 210 | } |
211 | }) | 211 | }) |
diff --git a/server/tests/api/check-params/views.ts b/server/tests/api/check-params/views.ts index 8f1fa796b..9bf1ef6c3 100644 --- a/server/tests/api/check-params/views.ts +++ b/server/tests/api/check-params/views.ts | |||
@@ -64,12 +64,12 @@ describe('Test videos views', function () { | |||
64 | }) | 64 | }) |
65 | 65 | ||
66 | it('Should fail without token', async function () { | 66 | it('Should fail without token', async function () { |
67 | await servers[0].videoStats.getOverallStats({ videoId: videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) | 67 | await servers[0].videoStats.getOverallStats({ videoId, token: null, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) |
68 | }) | 68 | }) |
69 | 69 | ||
70 | it('Should fail with another token', async function () { | 70 | it('Should fail with another token', async function () { |
71 | await servers[0].videoStats.getOverallStats({ | 71 | await servers[0].videoStats.getOverallStats({ |
72 | videoId: videoId, | 72 | videoId, |
73 | token: userAccessToken, | 73 | token: userAccessToken, |
74 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | 74 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
75 | }) | 75 | }) |
@@ -114,7 +114,7 @@ describe('Test videos views', function () { | |||
114 | 114 | ||
115 | it('Should fail without token', async function () { | 115 | it('Should fail without token', async function () { |
116 | await servers[0].videoStats.getTimeserieStats({ | 116 | await servers[0].videoStats.getTimeserieStats({ |
117 | videoId: videoId, | 117 | videoId, |
118 | token: null, | 118 | token: null, |
119 | metric: 'viewers', | 119 | metric: 'viewers', |
120 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 | 120 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 |
@@ -123,7 +123,7 @@ describe('Test videos views', function () { | |||
123 | 123 | ||
124 | it('Should fail with another token', async function () { | 124 | it('Should fail with another token', async function () { |
125 | await servers[0].videoStats.getTimeserieStats({ | 125 | await servers[0].videoStats.getTimeserieStats({ |
126 | videoId: videoId, | 126 | videoId, |
127 | token: userAccessToken, | 127 | token: userAccessToken, |
128 | metric: 'viewers', | 128 | metric: 'viewers', |
129 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | 129 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
@@ -198,7 +198,7 @@ describe('Test videos views', function () { | |||
198 | 198 | ||
199 | it('Should fail without token', async function () { | 199 | it('Should fail without token', async function () { |
200 | await servers[0].videoStats.getRetentionStats({ | 200 | await servers[0].videoStats.getRetentionStats({ |
201 | videoId: videoId, | 201 | videoId, |
202 | token: null, | 202 | token: null, |
203 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 | 203 | expectedStatus: HttpStatusCode.UNAUTHORIZED_401 |
204 | }) | 204 | }) |
@@ -206,7 +206,7 @@ describe('Test videos views', function () { | |||
206 | 206 | ||
207 | it('Should fail with another token', async function () { | 207 | it('Should fail with another token', async function () { |
208 | await servers[0].videoStats.getRetentionStats({ | 208 | await servers[0].videoStats.getRetentionStats({ |
209 | videoId: videoId, | 209 | videoId, |
210 | token: userAccessToken, | 210 | token: userAccessToken, |
211 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | 211 | expectedStatus: HttpStatusCode.FORBIDDEN_403 |
212 | }) | 212 | }) |
diff --git a/server/tests/api/notifications/admin-notifications.ts b/server/tests/api/notifications/admin-notifications.ts index f037e7aae..1501f9227 100644 --- a/server/tests/api/notifications/admin-notifications.ts +++ b/server/tests/api/notifications/admin-notifications.ts | |||
@@ -51,7 +51,7 @@ describe('Test admin notifications', function () { | |||
51 | adminNotifications = res.adminNotifications | 51 | adminNotifications = res.adminNotifications |
52 | 52 | ||
53 | baseParams = { | 53 | baseParams = { |
54 | server: server, | 54 | server, |
55 | emails, | 55 | emails, |
56 | socketNotifications: adminNotifications, | 56 | socketNotifications: adminNotifications, |
57 | token: server.accessToken | 57 | token: server.accessToken |
diff --git a/server/tests/api/notifications/notifications-api.ts b/server/tests/api/notifications/notifications-api.ts index 78864c8a0..e2b4777c0 100644 --- a/server/tests/api/notifications/notifications-api.ts +++ b/server/tests/api/notifications/notifications-api.ts | |||
@@ -99,7 +99,7 @@ describe('Test notifications API', function () { | |||
99 | 99 | ||
100 | before(() => { | 100 | before(() => { |
101 | baseParams = { | 101 | baseParams = { |
102 | server: server, | 102 | server, |
103 | emails, | 103 | emails, |
104 | socketNotifications: userNotifications, | 104 | socketNotifications: userNotifications, |
105 | token: userToken | 105 | token: userToken |
diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.ts index 0f7ffcb4c..9887d2535 100644 --- a/server/tests/api/redundancy/redundancy.ts +++ b/server/tests/api/redundancy/redundancy.ts | |||
@@ -53,7 +53,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition | |||
53 | strategies.push( | 53 | strategies.push( |
54 | { | 54 | { |
55 | min_lifetime: '1 hour', | 55 | min_lifetime: '1 hour', |
56 | strategy: strategy, | 56 | strategy, |
57 | size: '400KB', | 57 | size: '400KB', |
58 | 58 | ||
59 | ...additionalParams | 59 | ...additionalParams |
diff --git a/server/tests/api/search/search-videos.ts b/server/tests/api/search/search-videos.ts index ff4c3c161..b1ebc855c 100644 --- a/server/tests/api/search/search-videos.ts +++ b/server/tests/api/search/search-videos.ts | |||
@@ -106,7 +106,7 @@ describe('Test videos search', function () { | |||
106 | licence: 2, | 106 | licence: 2, |
107 | language: 'en' | 107 | language: 'en' |
108 | } | 108 | } |
109 | await server.videos.upload({ attributes: attributes }) | 109 | await server.videos.upload({ attributes }) |
110 | 110 | ||
111 | await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) | 111 | await server.videos.upload({ attributes: { ...attributes, name: attributes.name + ' duplicate' } }) |
112 | } | 112 | } |
@@ -119,7 +119,7 @@ describe('Test videos search', function () { | |||
119 | licence: 3, | 119 | licence: 3, |
120 | language: 'pl' | 120 | language: 'pl' |
121 | } | 121 | } |
122 | await server.videos.upload({ attributes: attributes }) | 122 | await server.videos.upload({ attributes }) |
123 | } | 123 | } |
124 | 124 | ||
125 | { | 125 | { |
@@ -210,7 +210,7 @@ describe('Test videos search', function () { | |||
210 | const search = { | 210 | const search = { |
211 | categoryOneOf: [ 3 ] | 211 | categoryOneOf: [ 3 ] |
212 | } | 212 | } |
213 | const body = await command.advancedVideoSearch({ search: search }) | 213 | const body = await command.advancedVideoSearch({ search }) |
214 | 214 | ||
215 | expect(body.total).to.equal(1) | 215 | expect(body.total).to.equal(1) |
216 | 216 | ||
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts index 3dcd076f5..c45d3ea60 100644 --- a/server/tests/api/server/handle-down.ts +++ b/server/tests/api/server/handle-down.ts | |||
@@ -162,7 +162,7 @@ describe('Test handle downs', function () { | |||
162 | 162 | ||
163 | for (const state of states) { | 163 | for (const state of states) { |
164 | const body = await servers[0].jobs.list({ | 164 | const body = await servers[0].jobs.list({ |
165 | state: state, | 165 | state, |
166 | start: 0, | 166 | start: 0, |
167 | count: 50, | 167 | count: 50, |
168 | sort: '-createdAt' | 168 | sort: '-createdAt' |
diff --git a/server/tests/api/videos/video-nsfw.ts b/server/tests/api/videos/video-nsfw.ts index 99ea67a0f..34713025d 100644 --- a/server/tests/api/videos/video-nsfw.ts +++ b/server/tests/api/videos/video-nsfw.ts | |||
@@ -136,7 +136,7 @@ describe('Test video NSFW policy', function () { | |||
136 | it('Should create a user having the default nsfw policy', async function () { | 136 | it('Should create a user having the default nsfw policy', async function () { |
137 | const username = 'user1' | 137 | const username = 'user1' |
138 | const password = 'my super password' | 138 | const password = 'my super password' |
139 | await server.users.create({ username: username, password: password }) | 139 | await server.users.create({ username, password }) |
140 | 140 | ||
141 | userAccessToken = await server.login.getAccessToken({ username, password }) | 141 | userAccessToken = await server.login.getAccessToken({ username, password }) |
142 | 142 | ||
diff --git a/server/tests/plugins/filter-hooks.ts b/server/tests/plugins/filter-hooks.ts index e0f25ca26..b1f83d201 100644 --- a/server/tests/plugins/filter-hooks.ts +++ b/server/tests/plugins/filter-hooks.ts | |||
@@ -395,7 +395,7 @@ describe('Test plugin filter hooks', function () { | |||
395 | const uuids: string[] = [] | 395 | const uuids: string[] = [] |
396 | 396 | ||
397 | for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { | 397 | for (const name of [ 'bad torrent', 'bad file', 'bad playlist file' ]) { |
398 | const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid | 398 | const uuid = (await servers[0].videos.quickUpload({ name })).uuid |
399 | uuids.push(uuid) | 399 | uuids.push(uuid) |
400 | } | 400 | } |
401 | 401 | ||
@@ -446,7 +446,7 @@ describe('Test plugin filter hooks', function () { | |||
446 | 446 | ||
447 | for (const name of [ 'bad embed', 'good embed' ]) { | 447 | for (const name of [ 'bad embed', 'good embed' ]) { |
448 | { | 448 | { |
449 | const uuid = (await servers[0].videos.quickUpload({ name: name })).uuid | 449 | const uuid = (await servers[0].videos.quickUpload({ name })).uuid |
450 | embedVideos.push(await servers[0].videos.get({ id: uuid })) | 450 | embedVideos.push(await servers[0].videos.get({ id: uuid })) |
451 | } | 451 | } |
452 | 452 | ||
diff --git a/server/tests/shared/notifications.ts b/server/tests/shared/notifications.ts index 09bc8da03..ee15e2b09 100644 --- a/server/tests/shared/notifications.ts +++ b/server/tests/shared/notifications.ts | |||
@@ -780,7 +780,7 @@ async function checkNotification (options: CheckerBaseParams & { | |||
780 | const check = options.check || { web: true, mail: true } | 780 | const check = options.check || { web: true, mail: true } |
781 | 781 | ||
782 | if (check.web) { | 782 | if (check.web) { |
783 | const notification = await server.notifications.getLatest({ token: token }) | 783 | const notification = await server.notifications.getLatest({ token }) |
784 | 784 | ||
785 | if (notification || checkType !== 'absence') { | 785 | if (notification || checkType !== 'absence') { |
786 | notificationChecker(notification, checkType) | 786 | notificationChecker(notification, checkType) |