aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-24 19:41:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commit72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch)
tree1bfdee99dbe2392cc997edba8e314e2a8a401c72 /shared/models
parent8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff)
downloadPeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip
Add video channels
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/pods/remote-video/index.ts5
-rw-r--r--shared/models/pods/remote-video/remote-video-author-create-request.model.ts11
-rw-r--r--shared/models/pods/remote-video/remote-video-author-remove-request.model.ts10
-rw-r--r--shared/models/pods/remote-video/remote-video-channel-create-request.model.ts15
-rw-r--r--shared/models/pods/remote-video/remote-video-channel-remove-request.model.ts10
-rw-r--r--shared/models/pods/remote-video/remote-video-channel-update-request.model.ts15
-rw-r--r--shared/models/pods/remote-video/remote-video-create-request.model.ts4
-rw-r--r--shared/models/pods/remote-video/remote-video-remove-request.model.ts2
-rw-r--r--shared/models/pods/remote-video/remote-video-request.model.ts7
-rw-r--r--shared/models/pods/remote-video/remote-video-update-request.model.ts6
-rw-r--r--shared/models/users/user.model.ts8
-rw-r--r--shared/models/videos/index.ts3
-rw-r--r--shared/models/videos/video-channel-create.model.ts4
-rw-r--r--shared/models/videos/video-channel-update.model.ts4
-rw-r--r--shared/models/videos/video-channel.model.ts15
-rw-r--r--shared/models/videos/video-create.model.ts1
-rw-r--r--shared/models/videos/video.model.ts6
17 files changed, 119 insertions, 7 deletions
diff --git a/shared/models/pods/remote-video/index.ts b/shared/models/pods/remote-video/index.ts
index c88116849..918b9e1f6 100644
--- a/shared/models/pods/remote-video/index.ts
+++ b/shared/models/pods/remote-video/index.ts
@@ -1,7 +1,12 @@
1export * from './remote-qadu-video-request.model' 1export * from './remote-qadu-video-request.model'
2export * from './remote-video-author-create-request.model'
3export * from './remote-video-author-remove-request.model'
2export * from './remote-video-event-request.model' 4export * from './remote-video-event-request.model'
3export * from './remote-video-request.model' 5export * from './remote-video-request.model'
4export * from './remote-video-create-request.model' 6export * from './remote-video-create-request.model'
5export * from './remote-video-update-request.model' 7export * from './remote-video-update-request.model'
6export * from './remote-video-remove-request.model' 8export * from './remote-video-remove-request.model'
9export * from './remote-video-channel-create-request.model'
10export * from './remote-video-channel-update-request.model'
11export * from './remote-video-channel-remove-request.model'
7export * from './remote-video-report-abuse-request.model' 12export * from './remote-video-report-abuse-request.model'
diff --git a/shared/models/pods/remote-video/remote-video-author-create-request.model.ts b/shared/models/pods/remote-video/remote-video-author-create-request.model.ts
new file mode 100644
index 000000000..ae364d177
--- /dev/null
+++ b/shared/models/pods/remote-video/remote-video-author-create-request.model.ts
@@ -0,0 +1,11 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
3export interface RemoteVideoAuthorCreateData {
4 uuid: string
5 name: string
6}
7
8export interface RemoteVideoAuthorCreateRequest extends RemoteVideoRequest {
9 type: 'add-author'
10 data: RemoteVideoAuthorCreateData
11}
diff --git a/shared/models/pods/remote-video/remote-video-author-remove-request.model.ts b/shared/models/pods/remote-video/remote-video-author-remove-request.model.ts
new file mode 100644
index 000000000..8738e92f0
--- /dev/null
+++ b/shared/models/pods/remote-video/remote-video-author-remove-request.model.ts
@@ -0,0 +1,10 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
3export interface RemoteVideoAuthorRemoveData {
4 uuid: string
5}
6
7export interface RemoteVideoAuthorRemoveRequest extends RemoteVideoRequest {
8 type: 'remove-author'
9 data: RemoteVideoAuthorRemoveData
10}
diff --git a/shared/models/pods/remote-video/remote-video-channel-create-request.model.ts b/shared/models/pods/remote-video/remote-video-channel-create-request.model.ts
new file mode 100644
index 000000000..54163a2db
--- /dev/null
+++ b/shared/models/pods/remote-video/remote-video-channel-create-request.model.ts
@@ -0,0 +1,15 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
3export interface RemoteVideoChannelCreateData {
4 uuid: string
5 name: string
6 description: string
7 createdAt: Date
8 updatedAt: Date
9 ownerUUID: string
10}
11
12export interface RemoteVideoChannelCreateRequest extends RemoteVideoRequest {
13 type: 'add-channel'
14 data: RemoteVideoChannelCreateData
15}
diff --git a/shared/models/pods/remote-video/remote-video-channel-remove-request.model.ts b/shared/models/pods/remote-video/remote-video-channel-remove-request.model.ts
new file mode 100644
index 000000000..7aa3fe112
--- /dev/null
+++ b/shared/models/pods/remote-video/remote-video-channel-remove-request.model.ts
@@ -0,0 +1,10 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
3export interface RemoteVideoChannelRemoveData {
4 uuid: string
5}
6
7export interface RemoteVideoChannelRemoveRequest extends RemoteVideoRequest {
8 type: 'remove-channel'
9 data: RemoteVideoChannelRemoveData
10}
diff --git a/shared/models/pods/remote-video/remote-video-channel-update-request.model.ts b/shared/models/pods/remote-video/remote-video-channel-update-request.model.ts
new file mode 100644
index 000000000..70250d109
--- /dev/null
+++ b/shared/models/pods/remote-video/remote-video-channel-update-request.model.ts
@@ -0,0 +1,15 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
3export interface RemoteVideoChannelUpdateData {
4 uuid: string
5 name: string
6 description: string
7 createdAt: Date
8 updatedAt: Date
9 ownerUUID: string
10}
11
12export interface RemoteVideoChannelUpdateRequest extends RemoteVideoRequest {
13 type: 'update-channel'
14 data: RemoteVideoChannelUpdateData
15}
diff --git a/shared/models/pods/remote-video/remote-video-create-request.model.ts b/shared/models/pods/remote-video/remote-video-create-request.model.ts
index 98425e4d9..e00e81214 100644
--- a/shared/models/pods/remote-video/remote-video-create-request.model.ts
+++ b/shared/models/pods/remote-video/remote-video-create-request.model.ts
@@ -2,7 +2,7 @@ import { RemoteVideoRequest } from './remote-video-request.model'
2 2
3export interface RemoteVideoCreateData { 3export interface RemoteVideoCreateData {
4 uuid: string 4 uuid: string
5 author: string 5 channelUUID: string
6 tags: string[] 6 tags: string[]
7 name: string 7 name: string
8 category: number 8 category: number
@@ -26,6 +26,6 @@ export interface RemoteVideoCreateData {
26} 26}
27 27
28export interface RemoteVideoCreateRequest extends RemoteVideoRequest { 28export interface RemoteVideoCreateRequest extends RemoteVideoRequest {
29 type: 'add' 29 type: 'add-video'
30 data: RemoteVideoCreateData 30 data: RemoteVideoCreateData
31} 31}
diff --git a/shared/models/pods/remote-video/remote-video-remove-request.model.ts b/shared/models/pods/remote-video/remote-video-remove-request.model.ts
index 0686dc8ab..79a5e0a5f 100644
--- a/shared/models/pods/remote-video/remote-video-remove-request.model.ts
+++ b/shared/models/pods/remote-video/remote-video-remove-request.model.ts
@@ -5,6 +5,6 @@ export interface RemoteVideoRemoveData {
5} 5}
6 6
7export interface RemoteVideoRemoveRequest extends RemoteVideoRequest { 7export interface RemoteVideoRemoveRequest extends RemoteVideoRequest {
8 type: 'remove' 8 type: 'remove-video'
9 data: RemoteVideoRemoveData 9 data: RemoteVideoRemoveData
10} 10}
diff --git a/shared/models/pods/remote-video/remote-video-request.model.ts b/shared/models/pods/remote-video/remote-video-request.model.ts
index e5052a23d..56f8136c2 100644
--- a/shared/models/pods/remote-video/remote-video-request.model.ts
+++ b/shared/models/pods/remote-video/remote-video-request.model.ts
@@ -1,4 +1,9 @@
1export interface RemoteVideoRequest { 1export interface RemoteVideoRequest {
2 type: 'add' | 'update' | 'remove' | 'report-abuse' 2 type: RemoteVideoRequestType
3 data: any 3 data: any
4} 4}
5
6export type RemoteVideoRequestType = 'add-video' | 'update-video' | 'remove-video' |
7 'add-channel' | 'update-channel' | 'remove-channel' |
8 'report-abuse' |
9 'add-author' | 'remove-author'
diff --git a/shared/models/pods/remote-video/remote-video-update-request.model.ts b/shared/models/pods/remote-video/remote-video-update-request.model.ts
index 7f34a30ae..90c42fc28 100644
--- a/shared/models/pods/remote-video/remote-video-update-request.model.ts
+++ b/shared/models/pods/remote-video/remote-video-update-request.model.ts
@@ -1,3 +1,5 @@
1import { RemoteVideoRequest } from './remote-video-request.model'
2
1export interface RemoteVideoUpdateData { 3export interface RemoteVideoUpdateData {
2 uuid: string 4 uuid: string
3 tags: string[] 5 tags: string[]
@@ -21,7 +23,7 @@ export interface RemoteVideoUpdateData {
21 }[] 23 }[]
22} 24}
23 25
24export interface RemoteVideoUpdateRequest { 26export interface RemoteVideoUpdateRequest extends RemoteVideoRequest {
25 type: 'update' 27 type: 'update-video'
26 data: RemoteVideoUpdateData 28 data: RemoteVideoUpdateData
27} 29}
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts
index 867a6dde5..175e72f28 100644
--- a/shared/models/users/user.model.ts
+++ b/shared/models/users/user.model.ts
@@ -1,4 +1,5 @@
1import { UserRole } from './user-role.type' 1import { UserRole } from './user-role.type'
2import { VideoChannel } from '../videos/video-channel.model'
2 3
3export interface User { 4export interface User {
4 id: number 5 id: number
@@ -7,5 +8,10 @@ export interface User {
7 displayNSFW: boolean 8 displayNSFW: boolean
8 role: UserRole 9 role: UserRole
9 videoQuota: number 10 videoQuota: number
10 createdAt: Date 11 createdAt: Date,
12 author: {
13 id: number
14 uuid: string
15 }
16 videoChannels?: VideoChannel[]
11} 17}
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
index 35144dbad..2a3912f06 100644
--- a/shared/models/videos/index.ts
+++ b/shared/models/videos/index.ts
@@ -4,6 +4,9 @@ export * from './user-video-rate.type'
4export * from './video-abuse-create.model' 4export * from './video-abuse-create.model'
5export * from './video-abuse.model' 5export * from './video-abuse.model'
6export * from './video-blacklist.model' 6export * from './video-blacklist.model'
7export * from './video-channel-create.model'
8export * from './video-channel-update.model'
9export * from './video-channel.model'
7export * from './video-create.model' 10export * from './video-create.model'
8export * from './video-rate.type' 11export * from './video-rate.type'
9export * from './video-resolution.enum' 12export * from './video-resolution.enum'
diff --git a/shared/models/videos/video-channel-create.model.ts b/shared/models/videos/video-channel-create.model.ts
new file mode 100644
index 000000000..f309c8f45
--- /dev/null
+++ b/shared/models/videos/video-channel-create.model.ts
@@ -0,0 +1,4 @@
1export interface VideoChannelCreate {
2 name: string
3 description?: string
4}
diff --git a/shared/models/videos/video-channel-update.model.ts b/shared/models/videos/video-channel-update.model.ts
new file mode 100644
index 000000000..4e98e39a8
--- /dev/null
+++ b/shared/models/videos/video-channel-update.model.ts
@@ -0,0 +1,4 @@
1export interface VideoChannelUpdate {
2 name: string
3 description: string
4}
diff --git a/shared/models/videos/video-channel.model.ts b/shared/models/videos/video-channel.model.ts
new file mode 100644
index 000000000..ee56c54b6
--- /dev/null
+++ b/shared/models/videos/video-channel.model.ts
@@ -0,0 +1,15 @@
1import { Video } from './video.model'
2
3export interface VideoChannel {
4 id: number
5 name: string
6 description: string
7 isLocal: boolean
8 createdAt: Date | string
9 updatedAt: Date | string
10 owner?: {
11 name: string
12 uuid: string
13 }
14 videos?: Video[]
15}
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts
index 5c0b498ce..4d0e83520 100644
--- a/shared/models/videos/video-create.model.ts
+++ b/shared/models/videos/video-create.model.ts
@@ -3,6 +3,7 @@ export interface VideoCreate {
3 licence: number 3 licence: number
4 language: number 4 language: number
5 description: string 5 description: string
6 channelId: number
6 nsfw: boolean 7 nsfw: boolean
7 name: string 8 name: string
8 tags: string[] 9 tags: string[]
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 8e47ac069..32463933d 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -1,3 +1,5 @@
1import { VideoChannel } from './video-channel.model'
2
1export interface VideoFile { 3export interface VideoFile {
2 magnetUri: string 4 magnetUri: string
3 resolution: number 5 resolution: number
@@ -32,5 +34,9 @@ export interface Video {
32 likes: number 34 likes: number
33 dislikes: number 35 dislikes: number
34 nsfw: boolean 36 nsfw: boolean
37}
38
39export interface VideoDetails extends Video {
40 channel: VideoChannel
35 files: VideoFile[] 41 files: VideoFile[]
36} 42}