aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-02 15:34:09 +0200
committerChocobozzz <me@florianbigard.com>2018-08-06 11:19:16 +0200
commitfbad87b0472f574409f7aa3ae7f8b54927d0cdd6 (patch)
tree197b4209e75d57dabae7cdd6f2da5f765e427023 /shared/models
parent5e319fb7898fd0482c399cc3ae9dcfc20d274a58 (diff)
downloadPeerTube-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.ts3
-rw-r--r--shared/models/videos/index.ts4
-rw-r--r--shared/models/videos/video-import-create.model.ts6
-rw-r--r--shared/models/videos/video-import-state.enum.ts5
-rw-r--r--shared/models/videos/video-import-update.model.ts5
-rw-r--r--shared/models/videos/video-import.model.ts7
-rw-r--r--shared/models/videos/video-state.enum.ts3
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
11export interface Job { 12export 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'
15export * from './video.model' 15export * from './video.model'
16export * from './video-state.enum' 16export * from './video-state.enum'
17export * from './video-caption-update.model' 17export * from './video-caption-update.model'
18export * from './video-import-create.model'
19export * from './video-import-update.model'
20export * from './video-import-state.enum'
21export * from './video-import.model'
18export { VideoConstant } from './video-constant.model' 22export { 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 @@
1import { VideoUpdate } from './video-update.model'
2
3export 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 @@
1export 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 @@
1import { VideoUpdate } from './video-update.model'
2
3export 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 @@
1import { Video } from './video.model'
2
3export 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 @@
1export enum VideoState { 1export enum VideoState {
2 PUBLISHED = 1, 2 PUBLISHED = 1,
3 TO_TRANSCODE = 2 3 TO_TRANSCODE = 2,
4 TO_IMPORT = 3
4} 5}