Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Rename jobs list command

Chocobozzz851675c5591d
diff --git a/server/tests/api/server/handle-down.ts b/server/tests/api/server/handle-down.ts
index 2f39503540..b3255a7213 100644
--- a/server/tests/api/server/handle-down.ts
+++ b/server/tests/api/server/handle-down.ts
@@ -161,7 +161,7 @@ describe('Test handle downs', function () {
const states: JobState[] = [ 'waiting', 'active' ]
for (const state of states) {
- const body = await servers[0].jobs.getJobsList({
+ const body = await servers[0].jobs.list({
state: state,
start: 0,
count: 50,
diff --git a/server/tests/api/server/jobs.ts b/server/tests/api/server/jobs.ts
index c10c154c2a..937028e4f7 100644
--- a/server/tests/api/server/jobs.ts
+++ b/server/tests/api/server/jobs.ts
@@ -38,14 +38,14 @@ describe('Test jobs', function () {
})
it('Should list jobs', async function () {
- const body = await servers[1].jobs.getJobsList({ state: 'completed' })
+ const body = await servers[1].jobs.list({ state: 'completed' })
expect(body.total).to.be.above(2)
expect(body.data).to.have.length.above(2)
})
it('Should list jobs with sort, pagination and job type', async function () {
{
- const body = await servers[1].jobs.getJobsList({
+ const body = await servers[1].jobs.list({
state: 'completed',
start: 1,
count: 2,
@@ -66,7 +66,7 @@ describe('Test jobs', function () {
}
{
- const body = await servers[1].jobs.getJobsList({
+ const body = await servers[1].jobs.list({
state: 'completed',
start: 0,
count: 100,
@@ -82,7 +82,7 @@ describe('Test jobs', function () {
})
it('Should list all jobs', async function () {
- const body = await servers[1].jobs.getJobsList()
+ const body = await servers[1].jobs.list()
expect(body.total).to.be.above(2)
const jobs = body.data
diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts
index f67752d69a..2b49176b2a 100644
--- a/server/tests/api/videos/video-transcoder.ts
+++ b/server/tests/api/videos/video-transcoder.ts
@@ -693,7 +693,7 @@ describe('Test video transcoding', function () {
describe('Transcoding job queue', function () {
it('Should have the appropriate priorities for transcoding jobs', async function () {
- const body = await servers[1].jobs.getJobsList({
+ const body = await servers[1].jobs.list({
start: 0,
count: 100,
sort: '-createdAt',
diff --git a/shared/extra-utils/server/jobs-command.ts b/shared/extra-utils/server/jobs-command.ts
index 91771c1760..f28397816e 100644
--- a/shared/extra-utils/server/jobs-command.ts
+++ b/shared/extra-utils/server/jobs-command.ts
@@ -8,14 +8,14 @@ export class JobsCommand extends AbstractCommand {
async getLatest (options: OverrideCommandOptions & {
jobType: JobType
}) {
- const { data } = await this.getJobsList({ ...options, start: 0, count: 1, sort: '-createdAt' })
+ const { data } = await this.list({ ...options, start: 0, count: 1, sort: '-createdAt' })
if (data.length === 0) return undefined
return data[0]
}
- getJobsList (options: OverrideCommandOptions & {
+ list (options: OverrideCommandOptions & {
state?: JobState
jobType?: JobType
start?: number
diff --git a/shared/extra-utils/server/jobs.ts b/shared/extra-utils/server/jobs.ts
index 27104bfdfb..79b8c31834 100644
--- a/shared/extra-utils/server/jobs.ts
+++ b/shared/extra-utils/server/jobs.ts
@@ -25,7 +25,7 @@ async function waitJobs (serversArg: PeerTubeServer[] | PeerTubeServer, skipDela
// Check if each server has pending request
for (const server of servers) {
for (const state of states) {
- const p = server.jobs.getJobsList({
+ const p = server.jobs.list({
state,
start: 0,
count: 10,