From fbad87b0472f574409f7aa3ae7f8b54927d0cdd6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 2 Aug 2018 15:34:09 +0200 Subject: Add ability to import video with youtube-dl --- shared/models/server/job.model.ts | 3 ++- shared/models/videos/index.ts | 4 ++++ shared/models/videos/video-import-create.model.ts | 6 ++++++ shared/models/videos/video-import-state.enum.ts | 5 +++++ shared/models/videos/video-import-update.model.ts | 5 +++++ shared/models/videos/video-import.model.ts | 7 +++++++ shared/models/videos/video-state.enum.ts | 3 ++- 7 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 shared/models/videos/video-import-create.model.ts create mode 100644 shared/models/videos/video-import-state.enum.ts create mode 100644 shared/models/videos/video-import-update.model.ts create mode 100644 shared/models/videos/video-import.model.ts (limited to 'shared/models') diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index a38a8aa3b..2565479f6 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts @@ -6,7 +6,8 @@ export type JobType = 'activitypub-http-unicast' | 'activitypub-follow' | 'video-file-import' | 'video-file' | - 'email' + 'email' | + 'video-import' export interface Job { id: number diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index cb9669772..1b135e26a 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts @@ -15,4 +15,8 @@ export * from './video-update.model' export * from './video.model' export * from './video-state.enum' export * from './video-caption-update.model' +export * from './video-import-create.model' +export * from './video-import-update.model' +export * from './video-import-state.enum' +export * from './video-import.model' export { VideoConstant } from './video-constant.model' diff --git a/shared/models/videos/video-import-create.model.ts b/shared/models/videos/video-import-create.model.ts new file mode 100644 index 000000000..65d142c2b --- /dev/null +++ b/shared/models/videos/video-import-create.model.ts @@ -0,0 +1,6 @@ +import { VideoUpdate } from './video-update.model' + +export interface VideoImportCreate extends VideoUpdate { + targetUrl: string + channelId: number // Required +} diff --git a/shared/models/videos/video-import-state.enum.ts b/shared/models/videos/video-import-state.enum.ts new file mode 100644 index 000000000..b178fbf3a --- /dev/null +++ b/shared/models/videos/video-import-state.enum.ts @@ -0,0 +1,5 @@ +export enum VideoImportState { + PENDING = 1, + SUCCESS = 2, + FAILED = 3 +} diff --git a/shared/models/videos/video-import-update.model.ts b/shared/models/videos/video-import-update.model.ts new file mode 100644 index 000000000..5ae244683 --- /dev/null +++ b/shared/models/videos/video-import-update.model.ts @@ -0,0 +1,5 @@ +import { VideoUpdate } from './video-update.model' + +export interface VideoImportUpdate extends VideoUpdate { + targetUrl: string +} diff --git a/shared/models/videos/video-import.model.ts b/shared/models/videos/video-import.model.ts new file mode 100644 index 000000000..858108599 --- /dev/null +++ b/shared/models/videos/video-import.model.ts @@ -0,0 +1,7 @@ +import { Video } from './video.model' + +export interface VideoImport { + targetUrl: string + + video: Video & { tags: string[] } +} diff --git a/shared/models/videos/video-state.enum.ts b/shared/models/videos/video-state.enum.ts index 625aefae1..a50e14e4b 100644 --- a/shared/models/videos/video-state.enum.ts +++ b/shared/models/videos/video-state.enum.ts @@ -1,4 +1,5 @@ export enum VideoState { PUBLISHED = 1, - TO_TRANSCODE = 2 + TO_TRANSCODE = 2, + TO_IMPORT = 3 } -- cgit v1.2.3