aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-30 14:58:00 +0200
committerChocobozzz <me@florianbigard.com>2018-08-31 09:19:58 +0200
commit2d3741d6d92e9bd1f41694c7442a6d1da434e1f2 (patch)
tree93a1e609e14bc14ca9e77a6661ddc9c0e461d6f3 /shared
parentd9eaee3939bf2e93e5d775d32bce77842201faba (diff)
downloadPeerTube-2d3741d6d92e9bd1f41694c7442a6d1da434e1f2.tar.gz
PeerTube-2d3741d6d92e9bd1f41694c7442a6d1da434e1f2.tar.zst
PeerTube-2d3741d6d92e9bd1f41694c7442a6d1da434e1f2.zip
Videos overview page: first version
Diffstat (limited to 'shared')
-rw-r--r--shared/models/index.ts1
-rw-r--r--shared/models/overviews/index.ts1
-rw-r--r--shared/models/overviews/videos-overview.ts18
-rw-r--r--shared/models/videos/video.model.ts41
4 files changed, 42 insertions, 19 deletions
diff --git a/shared/models/index.ts b/shared/models/index.ts
index 1db00c295..170f620e7 100644
--- a/shared/models/index.ts
+++ b/shared/models/index.ts
@@ -4,6 +4,7 @@ export * from './users'
4export * from './videos' 4export * from './videos'
5export * from './feeds' 5export * from './feeds'
6export * from './i18n' 6export * from './i18n'
7export * from './overviews'
7export * from './search' 8export * from './search'
8export * from './server/job.model' 9export * from './server/job.model'
9export * from './oauth-client-local.model' 10export * from './oauth-client-local.model'
diff --git a/shared/models/overviews/index.ts b/shared/models/overviews/index.ts
new file mode 100644
index 000000000..376609efa
--- /dev/null
+++ b/shared/models/overviews/index.ts
@@ -0,0 +1 @@
export * from './videos-overview'
diff --git a/shared/models/overviews/videos-overview.ts b/shared/models/overviews/videos-overview.ts
new file mode 100644
index 000000000..ee009d94c
--- /dev/null
+++ b/shared/models/overviews/videos-overview.ts
@@ -0,0 +1,18 @@
1import { Video, VideoChannelAttribute, VideoConstant } from '../videos'
2
3export interface VideosOverview {
4 channels: {
5 channel: VideoChannelAttribute
6 videos: Video[]
7 }[]
8
9 categories: {
10 category: VideoConstant<number>
11 videos: Video[]
12 }[]
13
14 tags: {
15 tag: string
16 videos: Video[]
17 }[]
18}
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 8e1fbe444..b47ab1ab8 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -17,6 +17,26 @@ export interface VideoFile {
17 fps: number 17 fps: number
18} 18}
19 19
20export interface VideoChannelAttribute {
21 id: number
22 uuid: string
23 name: string
24 displayName: string
25 url: string
26 host: string
27 avatar: Avatar
28}
29
30export interface AccountAttribute {
31 id: number
32 uuid: string
33 name: string
34 displayName: string
35 url: string
36 host: string
37 avatar: Avatar
38}
39
20export interface Video { 40export interface Video {
21 id: number 41 id: number
22 uuid: string 42 uuid: string
@@ -46,25 +66,8 @@ export interface Video {
46 blacklisted?: boolean 66 blacklisted?: boolean
47 blacklistedReason?: string 67 blacklistedReason?: string
48 68
49 account: { 69 account: AccountAttribute
50 id: number 70 channel: VideoChannelAttribute
51 uuid: string
52 name: string
53 displayName: string
54 url: string
55 host: string
56 avatar: Avatar
57 }
58
59 channel: {
60 id: number
61 uuid: string
62 name: string
63 displayName: string
64 url: string
65 host: string
66 avatar: Avatar
67 }
68} 71}
69 72
70export interface VideoDetails extends Video { 73export interface VideoDetails extends Video {