aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/models/videos/video-source.ts3
-rw-r--r--shared/server-commands/videos/videos-command.ts15
2 files changed, 18 insertions, 0 deletions
diff --git a/shared/models/videos/video-source.ts b/shared/models/videos/video-source.ts
new file mode 100644
index 000000000..57e54fc7f
--- /dev/null
+++ b/shared/models/videos/video-source.ts
@@ -0,0 +1,3 @@
1export interface VideoSource {
2 filename: string
3}
diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts
index 1cceb58db..e952c9777 100644
--- a/shared/server-commands/videos/videos-command.ts
+++ b/shared/server-commands/videos/videos-command.ts
@@ -23,6 +23,7 @@ import {
23import { unwrapBody } from '../requests' 23import { unwrapBody } from '../requests'
24import { waitJobs } from '../server' 24import { waitJobs } from '../server'
25import { AbstractCommand, OverrideCommandOptions } from '../shared' 25import { AbstractCommand, OverrideCommandOptions } from '../shared'
26import { VideoSource } from '@shared/models/videos/video-source'
26 27
27export type VideoEdit = Partial<Omit<VideoCreate, 'thumbnailfile' | 'previewfile'>> & { 28export type VideoEdit = Partial<Omit<VideoCreate, 'thumbnailfile' | 'previewfile'>> & {
28 fixture?: string 29 fixture?: string
@@ -150,6 +151,20 @@ export class VideosCommand extends AbstractCommand {
150 }) 151 })
151 } 152 }
152 153
154 getSource (options: OverrideCommandOptions & {
155 id: number | string
156 }) {
157 const path = '/api/v1/videos/' + options.id + '/source'
158
159 return this.getRequestBody<VideoSource>({
160 ...options,
161
162 path,
163 implicitToken: true,
164 defaultExpectedStatus: HttpStatusCode.OK_200
165 })
166 }
167
153 async getId (options: OverrideCommandOptions & { 168 async getId (options: OverrideCommandOptions & {
154 uuid: number | string 169 uuid: number | string
155 }) { 170 }) {