diff options
Diffstat (limited to 'shared/models/videos')
8 files changed, 77 insertions, 24 deletions
diff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.ts index 92918f66c..14a813f8f 100644 --- a/shared/models/videos/channel/video-channel.model.ts +++ b/shared/models/videos/channel/video-channel.model.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Actor } from '../../actors/actor.model' | 1 | import { Actor } from '../../actors/actor.model' |
2 | import { Video } from '../video.model' | ||
3 | import { Account } from '../../actors/index' | 2 | import { Account } from '../../actors/index' |
3 | import { Avatar } from '../../avatars' | ||
4 | 4 | ||
5 | export interface VideoChannel extends Actor { | 5 | export interface VideoChannel extends Actor { |
6 | displayName: string | 6 | displayName: string |
@@ -9,3 +9,13 @@ export interface VideoChannel extends Actor { | |||
9 | isLocal: boolean | 9 | isLocal: boolean |
10 | ownerAccount?: Account | 10 | ownerAccount?: Account |
11 | } | 11 | } |
12 | |||
13 | export interface VideoChannelSummary { | ||
14 | id: number | ||
15 | uuid: string | ||
16 | name: string | ||
17 | displayName: string | ||
18 | url: string | ||
19 | host: string | ||
20 | avatar?: Avatar | ||
21 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-create.model.ts b/shared/models/videos/playlist/video-playlist-create.model.ts new file mode 100644 index 000000000..386acbb96 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-create.model.ts | |||
@@ -0,0 +1,11 @@ | |||
1 | import { VideoPlaylistPrivacy } from './video-playlist-privacy.model' | ||
2 | |||
3 | export interface VideoPlaylistCreate { | ||
4 | displayName: string | ||
5 | description: string | ||
6 | privacy: VideoPlaylistPrivacy | ||
7 | |||
8 | videoChannelId?: number | ||
9 | |||
10 | thumbnailfile?: Blob | ||
11 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-element-create.model.ts b/shared/models/videos/playlist/video-playlist-element-create.model.ts new file mode 100644 index 000000000..9bd56a8ca --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-element-create.model.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export interface VideoPlaylistElementCreate { | ||
2 | startTimestamp?: number | ||
3 | stopTimestamp?: number | ||
4 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-element-update.model.ts b/shared/models/videos/playlist/video-playlist-element-update.model.ts new file mode 100644 index 000000000..15a30fbdc --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-element-update.model.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export interface VideoPlaylistElementUpdate { | ||
2 | startTimestamp?: number | ||
3 | stopTimestamp?: number | ||
4 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-privacy.model.ts b/shared/models/videos/playlist/video-playlist-privacy.model.ts new file mode 100644 index 000000000..96e5e2211 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-privacy.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export enum VideoPlaylistPrivacy { | ||
2 | PUBLIC = 1, | ||
3 | UNLISTED = 2, | ||
4 | PRIVATE = 3 | ||
5 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-update.model.ts b/shared/models/videos/playlist/video-playlist-update.model.ts new file mode 100644 index 000000000..c7a15c550 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-update.model.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | import { VideoPlaylistPrivacy } from './video-playlist-privacy.model' | ||
2 | |||
3 | export interface VideoPlaylistUpdate { | ||
4 | displayName: string | ||
5 | description: string | ||
6 | privacy: VideoPlaylistPrivacy | ||
7 | |||
8 | videoChannelId?: number | ||
9 | thumbnailfile?: Blob | ||
10 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist.model.ts b/shared/models/videos/playlist/video-playlist.model.ts new file mode 100644 index 000000000..6aa04048c --- /dev/null +++ b/shared/models/videos/playlist/video-playlist.model.ts | |||
@@ -0,0 +1,23 @@ | |||
1 | import { AccountSummary } from '../../actors/index' | ||
2 | import { VideoChannelSummary, VideoConstant } from '..' | ||
3 | import { VideoPlaylistPrivacy } from './video-playlist-privacy.model' | ||
4 | |||
5 | export interface VideoPlaylist { | ||
6 | id: number | ||
7 | uuid: string | ||
8 | isLocal: boolean | ||
9 | |||
10 | displayName: string | ||
11 | description: string | ||
12 | privacy: VideoConstant<VideoPlaylistPrivacy> | ||
13 | |||
14 | thumbnailPath: string | ||
15 | |||
16 | videosLength: number | ||
17 | |||
18 | createdAt: Date | string | ||
19 | updatedAt: Date | string | ||
20 | |||
21 | ownerAccount?: AccountSummary | ||
22 | videoChannel?: VideoChannelSummary | ||
23 | } | ||
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index df800461c..6e7a6831e 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoResolution, VideoState } from '../../index' | 1 | import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index' |
2 | import { Account } from '../actors' | 2 | import { Account } from '../actors' |
3 | import { Avatar } from '../avatars/avatar.model' | 3 | import { Avatar } from '../avatars/avatar.model' |
4 | import { VideoChannel } from './channel/video-channel.model' | 4 | import { VideoChannel } from './channel/video-channel.model' |
@@ -18,26 +18,6 @@ export interface VideoFile { | |||
18 | fps: number | 18 | fps: number |
19 | } | 19 | } |
20 | 20 | ||
21 | export interface VideoChannelAttribute { | ||
22 | id: number | ||
23 | uuid: string | ||
24 | name: string | ||
25 | displayName: string | ||
26 | url: string | ||
27 | host: string | ||
28 | avatar?: Avatar | ||
29 | } | ||
30 | |||
31 | export interface AccountAttribute { | ||
32 | id: number | ||
33 | uuid: string | ||
34 | name: string | ||
35 | displayName: string | ||
36 | url: string | ||
37 | host: string | ||
38 | avatar?: Avatar | ||
39 | } | ||
40 | |||
41 | export interface Video { | 21 | export interface Video { |
42 | id: number | 22 | id: number |
43 | uuid: string | 23 | uuid: string |
@@ -68,12 +48,18 @@ export interface Video { | |||
68 | blacklisted?: boolean | 48 | blacklisted?: boolean |
69 | blacklistedReason?: string | 49 | blacklistedReason?: string |
70 | 50 | ||
71 | account: AccountAttribute | 51 | account: AccountSummary |
72 | channel: VideoChannelAttribute | 52 | channel: VideoChannelSummary |
73 | 53 | ||
74 | userHistory?: { | 54 | userHistory?: { |
75 | currentTime: number | 55 | currentTime: number |
76 | } | 56 | } |
57 | |||
58 | playlistElement?: { | ||
59 | position: number | ||
60 | startTimestamp: number | ||
61 | stopTimestamp: number | ||
62 | } | ||
77 | } | 63 | } |
78 | 64 | ||
79 | export interface VideoDetails extends Video { | 65 | export interface VideoDetails extends Video { |