aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-01 14:51:16 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 10:16:55 +0200
commitd8f39b126d9fe4bec1c12fb213548cc6edc87867 (patch)
tree7f0f1cb23165cf4dd789b2d78b1fef7ee116f647 /shared/server-commands
parent1fb7d094229acdc190c3f7551b43ac5445814dee (diff)
downloadPeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.tar.gz
PeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.tar.zst
PeerTube-d8f39b126d9fe4bec1c12fb213548cc6edc87867.zip
Add storyboard support
Diffstat (limited to 'shared/server-commands')
-rw-r--r--shared/server-commands/server/config-command.ts7
-rw-r--r--shared/server-commands/server/jobs.ts15
-rw-r--r--shared/server-commands/server/server.ts5
-rw-r--r--shared/server-commands/videos/index.ts1
-rw-r--r--shared/server-commands/videos/storyboard-command.ts19
5 files changed, 46 insertions, 1 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index b94bd2625..114db8091 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -159,6 +159,10 @@ export class ConfigCommand extends AbstractCommand {
159 newConfig: { 159 newConfig: {
160 transcoding: { 160 transcoding: {
161 enabled: true, 161 enabled: true,
162
163 allowAudioFiles: true,
164 allowAdditionalExtensions: true,
165
162 resolutions: { 166 resolutions: {
163 ...ConfigCommand.getCustomConfigResolutions(false), 167 ...ConfigCommand.getCustomConfigResolutions(false),
164 168
@@ -368,6 +372,9 @@ export class ConfigCommand extends AbstractCommand {
368 }, 372 },
369 torrents: { 373 torrents: {
370 size: 4 374 size: 4
375 },
376 storyboards: {
377 size: 5
371 } 378 }
372 }, 379 },
373 signup: { 380 signup: {
diff --git a/shared/server-commands/server/jobs.ts b/shared/server-commands/server/jobs.ts
index ff3098063..8f131fba4 100644
--- a/shared/server-commands/server/jobs.ts
+++ b/shared/server-commands/server/jobs.ts
@@ -33,6 +33,8 @@ async function waitJobs (
33 33
34 // Check if each server has pending request 34 // Check if each server has pending request
35 for (const server of servers) { 35 for (const server of servers) {
36 if (process.env.DEBUG) console.log('Checking ' + server.url)
37
36 for (const state of states) { 38 for (const state of states) {
37 39
38 const jobPromise = server.jobs.list({ 40 const jobPromise = server.jobs.list({
@@ -45,6 +47,10 @@ async function waitJobs (
45 .then(jobs => { 47 .then(jobs => {
46 if (jobs.length !== 0) { 48 if (jobs.length !== 0) {
47 pendingRequests = true 49 pendingRequests = true
50
51 if (process.env.DEBUG) {
52 console.log(jobs)
53 }
48 } 54 }
49 }) 55 })
50 56
@@ -55,6 +61,10 @@ async function waitJobs (
55 .then(obj => { 61 .then(obj => {
56 if (obj.activityPubMessagesWaiting !== 0) { 62 if (obj.activityPubMessagesWaiting !== 0) {
57 pendingRequests = true 63 pendingRequests = true
64
65 if (process.env.DEBUG) {
66 console.log('AP messages waiting: ' + obj.activityPubMessagesWaiting)
67 }
58 } 68 }
59 }) 69 })
60 tasks.push(debugPromise) 70 tasks.push(debugPromise)
@@ -65,12 +75,15 @@ async function waitJobs (
65 for (const job of data) { 75 for (const job of data) {
66 if (job.state.id !== RunnerJobState.COMPLETED) { 76 if (job.state.id !== RunnerJobState.COMPLETED) {
67 pendingRequests = true 77 pendingRequests = true
78
79 if (process.env.DEBUG) {
80 console.log(job)
81 }
68 } 82 }
69 } 83 }
70 }) 84 })
71 tasks.push(runnerJobsPromise) 85 tasks.push(runnerJobsPromise)
72 } 86 }
73
74 } 87 }
75 88
76 return tasks 89 return tasks
diff --git a/shared/server-commands/server/server.ts b/shared/server-commands/server/server.ts
index 0911e22b0..6aa4296b0 100644
--- a/shared/server-commands/server/server.ts
+++ b/shared/server-commands/server/server.ts
@@ -35,6 +35,7 @@ import {
35 VideoPasswordsCommand, 35 VideoPasswordsCommand,
36 PlaylistsCommand, 36 PlaylistsCommand,
37 ServicesCommand, 37 ServicesCommand,
38 StoryboardCommand,
38 StreamingPlaylistsCommand, 39 StreamingPlaylistsCommand,
39 VideosCommand, 40 VideosCommand,
40 VideoStudioCommand, 41 VideoStudioCommand,
@@ -149,6 +150,8 @@ export class PeerTubeServer {
149 registrations?: RegistrationsCommand 150 registrations?: RegistrationsCommand
150 videoPasswords?: VideoPasswordsCommand 151 videoPasswords?: VideoPasswordsCommand
151 152
153 storyboard?: StoryboardCommand
154
152 runners?: RunnersCommand 155 runners?: RunnersCommand
153 runnerRegistrationTokens?: RunnerRegistrationTokensCommand 156 runnerRegistrationTokens?: RunnerRegistrationTokensCommand
154 runnerJobs?: RunnerJobsCommand 157 runnerJobs?: RunnerJobsCommand
@@ -436,6 +439,8 @@ export class PeerTubeServer {
436 this.videoToken = new VideoTokenCommand(this) 439 this.videoToken = new VideoTokenCommand(this)
437 this.registrations = new RegistrationsCommand(this) 440 this.registrations = new RegistrationsCommand(this)
438 441
442 this.storyboard = new StoryboardCommand(this)
443
439 this.runners = new RunnersCommand(this) 444 this.runners = new RunnersCommand(this)
440 this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this) 445 this.runnerRegistrationTokens = new RunnerRegistrationTokensCommand(this)
441 this.runnerJobs = new RunnerJobsCommand(this) 446 this.runnerJobs = new RunnerJobsCommand(this)
diff --git a/shared/server-commands/videos/index.ts b/shared/server-commands/videos/index.ts
index da36b5b6b..106d80af0 100644
--- a/shared/server-commands/videos/index.ts
+++ b/shared/server-commands/videos/index.ts
@@ -11,6 +11,7 @@ export * from './live-command'
11export * from './live' 11export * from './live'
12export * from './playlists-command' 12export * from './playlists-command'
13export * from './services-command' 13export * from './services-command'
14export * from './storyboard-command'
14export * from './streaming-playlists-command' 15export * from './streaming-playlists-command'
15export * from './comments-command' 16export * from './comments-command'
16export * from './video-studio-command' 17export * from './video-studio-command'
diff --git a/shared/server-commands/videos/storyboard-command.ts b/shared/server-commands/videos/storyboard-command.ts
new file mode 100644
index 000000000..06d90fc12
--- /dev/null
+++ b/shared/server-commands/videos/storyboard-command.ts
@@ -0,0 +1,19 @@
1import { HttpStatusCode, Storyboard } from '@shared/models'
2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4export class StoryboardCommand extends AbstractCommand {
5
6 list (options: OverrideCommandOptions & {
7 id: number | string
8 }) {
9 const path = '/api/v1/videos/' + options.id + '/storyboards'
10
11 return this.getRequestBody<{ storyboards: Storyboard[] }>({
12 ...options,
13
14 path,
15 implicitToken: true,
16 defaultExpectedStatus: HttpStatusCode.OK_200
17 })
18 }
19}