diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:07:03 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-28 11:09:03 +0200 |
commit | 89aa3331106874266f6feeee7bff852da2c1727e (patch) | |
tree | 6b03c6c4e4019b3d71da80f88a0775c2b5cbdd65 /shared | |
parent | ac8f81e3732548a28e0df03d588bf6777fad55cb (diff) | |
download | PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.tar.gz PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.tar.zst PeerTube-89aa3331106874266f6feeee7bff852da2c1727e.zip |
Add ability to force transcoding
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/server/server-error-code.enum.ts | 4 | ||||
-rw-r--r-- | shared/models/videos/transcoding/video-transcoding-create.model.ts | 2 | ||||
-rw-r--r-- | shared/server-commands/videos/videos-command.ts | 7 |
3 files changed, 7 insertions, 6 deletions
diff --git a/shared/models/server/server-error-code.enum.ts b/shared/models/server/server-error-code.enum.ts index 77d1e1d3f..583e8245f 100644 --- a/shared/models/server/server-error-code.enum.ts +++ b/shared/models/server/server-error-code.enum.ts | |||
@@ -52,7 +52,9 @@ export const enum ServerErrorCode { | |||
52 | UNKNOWN_RUNNER_TOKEN = 'unknown_runner_token', | 52 | UNKNOWN_RUNNER_TOKEN = 'unknown_runner_token', |
53 | 53 | ||
54 | VIDEO_REQUIRES_PASSWORD = 'video_requires_password', | 54 | VIDEO_REQUIRES_PASSWORD = 'video_requires_password', |
55 | INCORRECT_VIDEO_PASSWORD = 'incorrect_video_password' | 55 | INCORRECT_VIDEO_PASSWORD = 'incorrect_video_password', |
56 | |||
57 | VIDEO_ALREADY_BEING_TRANSCODED = 'video_already_being_transcoded' | ||
56 | } | 58 | } |
57 | 59 | ||
58 | /** | 60 | /** |
diff --git a/shared/models/videos/transcoding/video-transcoding-create.model.ts b/shared/models/videos/transcoding/video-transcoding-create.model.ts index c6e756a0a..6c2dbefa6 100644 --- a/shared/models/videos/transcoding/video-transcoding-create.model.ts +++ b/shared/models/videos/transcoding/video-transcoding-create.model.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | export interface VideoTranscodingCreate { | 1 | export interface VideoTranscodingCreate { |
2 | transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7 | 2 | transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7 |
3 | |||
4 | forceTranscoding?: boolean // Default false | ||
3 | } | 5 | } |
diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts index a58f1c545..4c3513ed4 100644 --- a/shared/server-commands/videos/videos-command.ts +++ b/shared/server-commands/videos/videos-command.ts | |||
@@ -775,19 +775,16 @@ export class VideosCommand extends AbstractCommand { | |||
775 | }) | 775 | }) |
776 | } | 776 | } |
777 | 777 | ||
778 | runTranscoding (options: OverrideCommandOptions & { | 778 | runTranscoding (options: OverrideCommandOptions & VideoTranscodingCreate & { |
779 | videoId: number | string | 779 | videoId: number | string |
780 | transcodingType: 'hls' | 'webtorrent' | 'web-video' | ||
781 | }) { | 780 | }) { |
782 | const path = '/api/v1/videos/' + options.videoId + '/transcoding' | 781 | const path = '/api/v1/videos/' + options.videoId + '/transcoding' |
783 | 782 | ||
784 | const fields: VideoTranscodingCreate = pick(options, [ 'transcodingType' ]) | ||
785 | |||
786 | return this.postBodyRequest({ | 783 | return this.postBodyRequest({ |
787 | ...options, | 784 | ...options, |
788 | 785 | ||
789 | path, | 786 | path, |
790 | fields, | 787 | fields: pick(options, [ 'transcodingType', 'forceTranscoding' ]), |
791 | implicitToken: true, | 788 | implicitToken: true, |
792 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | 789 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 |
793 | }) | 790 | }) |