diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-02 15:34:09 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-06 11:19:16 +0200 |
commit | fbad87b0472f574409f7aa3ae7f8b54927d0cdd6 (patch) | |
tree | 197b4209e75d57dabae7cdd6f2da5f765e427023 /shared/models | |
parent | 5e319fb7898fd0482c399cc3ae9dcfc20d274a58 (diff) | |
download | PeerTube-fbad87b0472f574409f7aa3ae7f8b54927d0cdd6.tar.gz PeerTube-fbad87b0472f574409f7aa3ae7f8b54927d0cdd6.tar.zst PeerTube-fbad87b0472f574409f7aa3ae7f8b54927d0cdd6.zip |
Add ability to import video with youtube-dl
Diffstat (limited to 'shared/models')
-rw-r--r-- | shared/models/server/job.model.ts | 3 | ||||
-rw-r--r-- | shared/models/videos/index.ts | 4 | ||||
-rw-r--r-- | shared/models/videos/video-import-create.model.ts | 6 | ||||
-rw-r--r-- | shared/models/videos/video-import-state.enum.ts | 5 | ||||
-rw-r--r-- | shared/models/videos/video-import-update.model.ts | 5 | ||||
-rw-r--r-- | shared/models/videos/video-import.model.ts | 7 | ||||
-rw-r--r-- | shared/models/videos/video-state.enum.ts | 3 |
7 files changed, 31 insertions, 2 deletions
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' | | |||
6 | 'activitypub-follow' | | 6 | 'activitypub-follow' | |
7 | 'video-file-import' | | 7 | 'video-file-import' | |
8 | 'video-file' | | 8 | 'video-file' | |
9 | 'email' | 9 | 'email' | |
10 | 'video-import' | ||
10 | 11 | ||
11 | export interface Job { | 12 | export interface Job { |
12 | id: number | 13 | 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' | |||
15 | export * from './video.model' | 15 | export * from './video.model' |
16 | export * from './video-state.enum' | 16 | export * from './video-state.enum' |
17 | export * from './video-caption-update.model' | 17 | export * from './video-caption-update.model' |
18 | export * from './video-import-create.model' | ||
19 | export * from './video-import-update.model' | ||
20 | export * from './video-import-state.enum' | ||
21 | export * from './video-import.model' | ||
18 | export { VideoConstant } from './video-constant.model' | 22 | 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 @@ | |||
1 | import { VideoUpdate } from './video-update.model' | ||
2 | |||
3 | export interface VideoImportCreate extends VideoUpdate { | ||
4 | targetUrl: string | ||
5 | channelId: number // Required | ||
6 | } | ||
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 @@ | |||
1 | export enum VideoImportState { | ||
2 | PENDING = 1, | ||
3 | SUCCESS = 2, | ||
4 | FAILED = 3 | ||
5 | } | ||
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 @@ | |||
1 | import { VideoUpdate } from './video-update.model' | ||
2 | |||
3 | export interface VideoImportUpdate extends VideoUpdate { | ||
4 | targetUrl: string | ||
5 | } | ||
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 @@ | |||
1 | import { Video } from './video.model' | ||
2 | |||
3 | export interface VideoImport { | ||
4 | targetUrl: string | ||
5 | |||
6 | video: Video & { tags: string[] } | ||
7 | } | ||
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 @@ | |||
1 | export enum VideoState { | 1 | export enum VideoState { |
2 | PUBLISHED = 1, | 2 | PUBLISHED = 1, |
3 | TO_TRANSCODE = 2 | 3 | TO_TRANSCODE = 2, |
4 | TO_IMPORT = 3 | ||
4 | } | 5 | } |