diff options
Diffstat (limited to 'shared/models')
46 files changed, 345 insertions, 67 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index 89994f665..95801190d 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts | |||
@@ -6,6 +6,7 @@ import { VideoAbuseObject } from './objects/video-abuse-object' | |||
6 | import { VideoCommentObject } from './objects/video-comment-object' | 6 | import { VideoCommentObject } from './objects/video-comment-object' |
7 | import { ViewObject } from './objects/view-object' | 7 | import { ViewObject } from './objects/view-object' |
8 | import { APObject } from './objects/object.model' | 8 | import { APObject } from './objects/object.model' |
9 | import { PlaylistObject } from './objects/playlist-object' | ||
9 | 10 | ||
10 | export type Activity = ActivityCreate | ActivityUpdate | | 11 | export type Activity = ActivityCreate | ActivityUpdate | |
11 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | | 12 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | |
@@ -31,12 +32,12 @@ export interface BaseActivity { | |||
31 | 32 | ||
32 | export interface ActivityCreate extends BaseActivity { | 33 | export interface ActivityCreate extends BaseActivity { |
33 | type: 'Create' | 34 | type: 'Create' |
34 | object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject | 35 | object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject | PlaylistObject |
35 | } | 36 | } |
36 | 37 | ||
37 | export interface ActivityUpdate extends BaseActivity { | 38 | export interface ActivityUpdate extends BaseActivity { |
38 | type: 'Update' | 39 | type: 'Update' |
39 | object: VideoTorrentObject | ActivityPubActor | CacheFileObject | 40 | object: VideoTorrentObject | ActivityPubActor | CacheFileObject | PlaylistObject |
40 | } | 41 | } |
41 | 42 | ||
42 | export interface ActivityDelete extends BaseActivity { | 43 | export interface ActivityDelete extends BaseActivity { |
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts index 119bc22d4..5e30bf783 100644 --- a/shared/models/activitypub/activitypub-actor.ts +++ b/shared/models/activitypub/activitypub-actor.ts | |||
@@ -8,6 +8,7 @@ export interface ActivityPubActor { | |||
8 | id: string | 8 | id: string |
9 | following: string | 9 | following: string |
10 | followers: string | 10 | followers: string |
11 | playlists?: string | ||
11 | inbox: string | 12 | inbox: string |
12 | outbox: string | 13 | outbox: string |
13 | preferredUsername: string | 14 | preferredUsername: string |
diff --git a/shared/models/activitypub/activitypub-ordered-collection.ts b/shared/models/activitypub/activitypub-ordered-collection.ts index dfec0bb76..3de0890bb 100644 --- a/shared/models/activitypub/activitypub-ordered-collection.ts +++ b/shared/models/activitypub/activitypub-ordered-collection.ts | |||
@@ -2,6 +2,9 @@ export interface ActivityPubOrderedCollection<T> { | |||
2 | '@context': string[] | 2 | '@context': string[] |
3 | type: 'OrderedCollection' | 'OrderedCollectionPage' | 3 | type: 'OrderedCollection' | 'OrderedCollectionPage' |
4 | totalItems: number | 4 | totalItems: number |
5 | partOf?: string | ||
6 | orderedItems: T[] | 5 | orderedItems: T[] |
6 | |||
7 | partOf?: string | ||
8 | next?: string | ||
9 | first?: string | ||
7 | } | 10 | } |
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts index 0a5125f5b..4b0a3a724 100644 --- a/shared/models/activitypub/objects/cache-file-object.ts +++ b/shared/models/activitypub/objects/cache-file-object.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { ActivityVideoUrlObject } from './common-objects' | 1 | import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-objects' |
2 | 2 | ||
3 | export interface CacheFileObject { | 3 | export interface CacheFileObject { |
4 | id: string | 4 | id: string |
5 | type: 'CacheFile', | 5 | type: 'CacheFile', |
6 | object: string | 6 | object: string |
7 | expires: string | 7 | expires: string |
8 | url: ActivityVideoUrlObject | 8 | url: ActivityVideoUrlObject | ActivityPlaylistUrlObject |
9 | } | 9 | } |
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts index 118a4f43d..8c89810d6 100644 --- a/shared/models/activitypub/objects/common-objects.ts +++ b/shared/models/activitypub/objects/common-objects.ts | |||
@@ -28,25 +28,47 @@ export type ActivityVideoUrlObject = { | |||
28 | fps: number | 28 | fps: number |
29 | } | 29 | } |
30 | 30 | ||
31 | export type ActivityUrlObject = | 31 | export type ActivityPlaylistSegmentHashesObject = { |
32 | ActivityVideoUrlObject | 32 | type: 'Link' |
33 | | | 33 | name: 'sha256' |
34 | { | 34 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) |
35 | type: 'Link' | 35 | mimeType?: 'application/json' |
36 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) | 36 | mediaType: 'application/json' |
37 | mimeType?: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' | 37 | href: string |
38 | mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' | 38 | } |
39 | href: string | 39 | |
40 | height: number | 40 | export type ActivityPlaylistInfohashesObject = { |
41 | } | 41 | type: 'Infohash' |
42 | | | 42 | name: string |
43 | { | 43 | } |
44 | type: 'Link' | 44 | |
45 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) | 45 | export type ActivityPlaylistUrlObject = { |
46 | mimeType?: 'text/html' | 46 | type: 'Link' |
47 | mediaType: 'text/html' | 47 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) |
48 | href: string | 48 | mimeType?: 'application/x-mpegURL' |
49 | } | 49 | mediaType: 'application/x-mpegURL' |
50 | href: string | ||
51 | tag?: (ActivityPlaylistSegmentHashesObject | ActivityPlaylistInfohashesObject)[] | ||
52 | } | ||
53 | |||
54 | export type ActivityBitTorrentUrlObject = { | ||
55 | type: 'Link' | ||
56 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) | ||
57 | mimeType?: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' | ||
58 | mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' | ||
59 | href: string | ||
60 | height: number | ||
61 | } | ||
62 | |||
63 | export type ActivityHtmlUrlObject = { | ||
64 | type: 'Link' | ||
65 | // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) | ||
66 | mimeType?: 'text/html' | ||
67 | mediaType: 'text/html' | ||
68 | href: string | ||
69 | } | ||
70 | |||
71 | export type ActivityUrlObject = ActivityVideoUrlObject | ActivityPlaylistUrlObject | ActivityBitTorrentUrlObject | ActivityHtmlUrlObject | ||
50 | 72 | ||
51 | export interface ActivityPubAttributedTo { | 73 | export interface ActivityPubAttributedTo { |
52 | type: 'Group' | 'Person' | 74 | type: 'Group' | 'Person' |
diff --git a/shared/models/activitypub/objects/playlist-element-object.ts b/shared/models/activitypub/objects/playlist-element-object.ts new file mode 100644 index 000000000..b85e4fe19 --- /dev/null +++ b/shared/models/activitypub/objects/playlist-element-object.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | export interface PlaylistElementObject { | ||
2 | id: string | ||
3 | type: 'PlaylistElement' | ||
4 | |||
5 | url: string | ||
6 | position: number | ||
7 | |||
8 | startTimestamp?: number | ||
9 | stopTimestamp?: number | ||
10 | } | ||
diff --git a/shared/models/activitypub/objects/playlist-object.ts b/shared/models/activitypub/objects/playlist-object.ts new file mode 100644 index 000000000..b561d8efd --- /dev/null +++ b/shared/models/activitypub/objects/playlist-object.ts | |||
@@ -0,0 +1,26 @@ | |||
1 | import { ActivityIconObject } from './common-objects' | ||
2 | |||
3 | export interface PlaylistObject { | ||
4 | id: string | ||
5 | type: 'Playlist' | ||
6 | |||
7 | name: string | ||
8 | content: string | ||
9 | uuid: string | ||
10 | |||
11 | totalItems: number | ||
12 | attributedTo: string[] | ||
13 | |||
14 | icon?: ActivityIconObject | ||
15 | |||
16 | published: string | ||
17 | updated: string | ||
18 | |||
19 | orderedItems?: string[] | ||
20 | |||
21 | partOf?: string | ||
22 | next?: string | ||
23 | first?: string | ||
24 | |||
25 | to?: string[] | ||
26 | } | ||
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts index 8504c178f..239822bc4 100644 --- a/shared/models/activitypub/objects/video-torrent-object.ts +++ b/shared/models/activitypub/objects/video-torrent-object.ts | |||
@@ -20,10 +20,12 @@ export interface VideoTorrentObject { | |||
20 | subtitleLanguage: ActivityIdentifierObject[] | 20 | subtitleLanguage: ActivityIdentifierObject[] |
21 | views: number | 21 | views: number |
22 | sensitive: boolean | 22 | sensitive: boolean |
23 | commentsEnabled: boolean | 23 | commentsEnabled: boolean, |
24 | downloadEnabled: boolean, | ||
24 | waitTranscoding: boolean | 25 | waitTranscoding: boolean |
25 | state: VideoState | 26 | state: VideoState |
26 | published: string | 27 | published: string |
28 | originallyPublishedAt: string | ||
27 | updated: string | 29 | updated: string |
28 | mediaType: 'text/markdown' | 30 | mediaType: 'text/markdown' |
29 | content: string | 31 | content: string |
diff --git a/shared/models/actors/account.model.ts b/shared/models/actors/account.model.ts index 7f1dbbc37..043a2507e 100644 --- a/shared/models/actors/account.model.ts +++ b/shared/models/actors/account.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Actor } from './actor.model' | 1 | import { Actor } from './actor.model' |
2 | import { Avatar } from '../avatars' | ||
2 | 3 | ||
3 | export interface Account extends Actor { | 4 | export interface Account extends Actor { |
4 | displayName: string | 5 | displayName: string |
@@ -6,3 +7,13 @@ export interface Account extends Actor { | |||
6 | 7 | ||
7 | userId?: number | 8 | userId?: number |
8 | } | 9 | } |
10 | |||
11 | export interface AccountSummary { | ||
12 | id: number | ||
13 | uuid: string | ||
14 | name: string | ||
15 | displayName: string | ||
16 | url: string | ||
17 | host: string | ||
18 | avatar?: Avatar | ||
19 | } | ||
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts index d7164b73f..5d1d3f2ab 100644 --- a/shared/models/i18n/i18n.ts +++ b/shared/models/i18n/i18n.ts | |||
@@ -3,16 +3,19 @@ export const LOCALE_FILES = [ 'player', 'server' ] | |||
3 | export const I18N_LOCALES = { | 3 | export const I18N_LOCALES = { |
4 | 'en-US': 'English', | 4 | 'en-US': 'English', |
5 | 'fr-FR': 'Français', | 5 | 'fr-FR': 'Français', |
6 | 'ja-JP': '日本語', | ||
6 | 'eu-ES': 'Euskara', | 7 | 'eu-ES': 'Euskara', |
7 | 'ca-ES': 'Català', | 8 | 'ca-ES': 'Català', |
8 | 'cs-CZ': 'Čeština', | 9 | 'cs-CZ': 'Čeština', |
9 | 'eo': 'Esperanto', | 10 | 'eo': 'Esperanto', |
10 | 'de-DE': 'Deutsch', | 11 | 'de-DE': 'Deutsch', |
11 | 'it-IT': 'Italiano', | 12 | 'it-IT': 'Italiano', |
13 | 'nl-NL': 'Nederlands', | ||
12 | 'es-ES': 'Español', | 14 | 'es-ES': 'Español', |
13 | 'oc': 'Occitan', | 15 | 'oc': 'Occitan', |
14 | 'zh-Hant-TW': '繁體中文(台灣)', | 16 | 'zh-Hant-TW': '繁體中文(台灣)', |
15 | 'pt-BR': 'Português (Brasil)', | 17 | 'pt-BR': 'Português (Brasil)', |
18 | 'pt-PT': 'Português (Portugal)', | ||
16 | 'sv-SE': 'svenska', | 19 | 'sv-SE': 'svenska', |
17 | 'pl-PL': 'Polski', | 20 | 'pl-PL': 'Polski', |
18 | 'ru-RU': 'русский', | 21 | 'ru-RU': 'русский', |
@@ -27,10 +30,12 @@ const I18N_LOCALE_ALIAS = { | |||
27 | 'cs': 'cs-CZ', | 30 | 'cs': 'cs-CZ', |
28 | 'de': 'de-DE', | 31 | 'de': 'de-DE', |
29 | 'es': 'es-ES', | 32 | 'es': 'es-ES', |
30 | 'pt': 'pt-BR', | 33 | 'pt': 'pt-PT', |
31 | 'sv': 'sv-SE', | 34 | 'sv': 'sv-SE', |
32 | 'pl': 'pl-PL', | 35 | 'pl': 'pl-PL', |
33 | 'ru': 'ru-RU' | 36 | 'ru': 'ru-RU', |
37 | 'nl': 'nl-NL', | ||
38 | 'zh': 'zh-Hans-CN' | ||
34 | } | 39 | } |
35 | 40 | ||
36 | export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES) | 41 | export const POSSIBLE_LOCALES = Object.keys(I18N_LOCALES) |
diff --git a/shared/models/overviews/videos-overview.ts b/shared/models/overviews/videos-overview.ts index ee009d94c..e725f166b 100644 --- a/shared/models/overviews/videos-overview.ts +++ b/shared/models/overviews/videos-overview.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Video, VideoChannelAttribute, VideoConstant } from '../videos' | 1 | import { Video, VideoChannelSummary, VideoConstant } from '../videos' |
2 | 2 | ||
3 | export interface VideosOverview { | 3 | export interface VideosOverview { |
4 | channels: { | 4 | channels: { |
5 | channel: VideoChannelAttribute | 5 | channel: VideoChannelSummary |
6 | videos: Video[] | 6 | videos: Video[] |
7 | }[] | 7 | }[] |
8 | 8 | ||
diff --git a/shared/models/search/videos-search-query.model.ts b/shared/models/search/videos-search-query.model.ts index 0db220758..838063095 100644 --- a/shared/models/search/videos-search-query.model.ts +++ b/shared/models/search/videos-search-query.model.ts | |||
@@ -11,6 +11,9 @@ export interface VideosSearchQuery { | |||
11 | startDate?: string // ISO 8601 | 11 | startDate?: string // ISO 8601 |
12 | endDate?: string // ISO 8601 | 12 | endDate?: string // ISO 8601 |
13 | 13 | ||
14 | originallyPublishedStartDate?: string // ISO 8601 | ||
15 | originallyPublishedEndDate?: string // ISO 8601 | ||
16 | |||
14 | nsfw?: NSFWQuery | 17 | nsfw?: NSFWQuery |
15 | 18 | ||
16 | categoryOneOf?: number[] | 19 | categoryOneOf?: number[] |
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 7a3eaa33f..ca52eff4b 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -6,6 +6,7 @@ export interface CustomConfig { | |||
6 | shortDescription: string | 6 | shortDescription: string |
7 | description: string | 7 | description: string |
8 | terms: string | 8 | terms: string |
9 | isNSFW: boolean | ||
9 | defaultClientRoute: string | 10 | defaultClientRoute: string |
10 | defaultNSFWPolicy: NSFWPolicyType | 11 | defaultNSFWPolicy: NSFWPolicyType |
11 | customizations: { | 12 | customizations: { |
@@ -61,6 +62,9 @@ export interface CustomConfig { | |||
61 | '720p': boolean | 62 | '720p': boolean |
62 | '1080p': boolean | 63 | '1080p': boolean |
63 | } | 64 | } |
65 | hls: { | ||
66 | enabled: boolean | ||
67 | } | ||
64 | } | 68 | } |
65 | 69 | ||
66 | import: { | 70 | import: { |
@@ -73,4 +77,20 @@ export interface CustomConfig { | |||
73 | } | 77 | } |
74 | } | 78 | } |
75 | } | 79 | } |
80 | |||
81 | autoBlacklist: { | ||
82 | videos: { | ||
83 | ofUsers: { | ||
84 | enabled: boolean | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | |||
89 | followers: { | ||
90 | instance: { | ||
91 | enabled: boolean, | ||
92 | manualApproval: boolean | ||
93 | } | ||
94 | } | ||
95 | |||
76 | } | 96 | } |
diff --git a/shared/models/server/debug.model.ts b/shared/models/server/debug.model.ts new file mode 100644 index 000000000..61cba6518 --- /dev/null +++ b/shared/models/server/debug.model.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export interface Debug { | ||
2 | ip: string | ||
3 | } | ||
diff --git a/shared/models/server/index.ts b/shared/models/server/index.ts index c42f6f67f..bf61ab270 100644 --- a/shared/models/server/index.ts +++ b/shared/models/server/index.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | export * from './about.model' | 1 | export * from './about.model' |
2 | export * from './contact-form.model' | 2 | export * from './contact-form.model' |
3 | export * from './custom-config.model' | 3 | export * from './custom-config.model' |
4 | export * from './debug.model' | ||
4 | export * from './job.model' | 5 | export * from './job.model' |
5 | export * from './server-config.model' | 6 | export * from './server-config.model' |
6 | export * from './server-stats.model' | 7 | export * from './server-stats.model' |
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index 85bc9541b..1b9aa8a07 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts | |||
@@ -5,7 +5,7 @@ export type JobType = 'activitypub-http-unicast' | | |||
5 | 'activitypub-http-fetcher' | | 5 | 'activitypub-http-fetcher' | |
6 | 'activitypub-follow' | | 6 | 'activitypub-follow' | |
7 | 'video-file-import' | | 7 | 'video-file-import' | |
8 | 'video-file' | | 8 | 'video-transcoding' | |
9 | 'email' | | 9 | 'email' | |
10 | 'video-import' | | 10 | 'video-import' | |
11 | 'videos-views' | | 11 | 'videos-views' | |
diff --git a/shared/models/server/log-level.type.ts b/shared/models/server/log-level.type.ts new file mode 100644 index 000000000..ce91559e3 --- /dev/null +++ b/shared/models/server/log-level.type.ts | |||
@@ -0,0 +1 @@ | |||
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | |||
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index f4245ed4d..d937e9c05 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts | |||
@@ -8,6 +8,7 @@ export interface ServerConfig { | |||
8 | name: string | 8 | name: string |
9 | shortDescription: string | 9 | shortDescription: string |
10 | defaultClientRoute: string | 10 | defaultClientRoute: string |
11 | isNSFW: boolean | ||
11 | defaultNSFWPolicy: NSFWPolicyType | 12 | defaultNSFWPolicy: NSFWPolicyType |
12 | customizations: { | 13 | customizations: { |
13 | javascript: string | 14 | javascript: string |
@@ -25,11 +26,15 @@ export interface ServerConfig { | |||
25 | 26 | ||
26 | signup: { | 27 | signup: { |
27 | allowed: boolean, | 28 | allowed: boolean, |
28 | allowedForCurrentIP: boolean, | 29 | allowedForCurrentIP: boolean |
29 | requiresEmailVerification: boolean | 30 | requiresEmailVerification: boolean |
30 | } | 31 | } |
31 | 32 | ||
32 | transcoding: { | 33 | transcoding: { |
34 | hls: { | ||
35 | enabled: boolean | ||
36 | } | ||
37 | |||
33 | enabledResolutions: number[] | 38 | enabledResolutions: number[] |
34 | } | 39 | } |
35 | 40 | ||
@@ -44,11 +49,19 @@ export interface ServerConfig { | |||
44 | } | 49 | } |
45 | } | 50 | } |
46 | 51 | ||
52 | autoBlacklist: { | ||
53 | videos: { | ||
54 | ofUsers: { | ||
55 | enabled: boolean | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | |||
47 | avatar: { | 60 | avatar: { |
48 | file: { | 61 | file: { |
49 | size: { | 62 | size: { |
50 | max: number | 63 | max: number |
51 | }, | 64 | } |
52 | extensions: string[] | 65 | extensions: string[] |
53 | } | 66 | } |
54 | } | 67 | } |
@@ -84,4 +97,8 @@ export interface ServerConfig { | |||
84 | intervalDays: number | 97 | intervalDays: number |
85 | } | 98 | } |
86 | } | 99 | } |
100 | |||
101 | tracker: { | ||
102 | enabled: boolean | ||
103 | } | ||
87 | } | 104 | } |
diff --git a/shared/models/users/user-create.model.ts b/shared/models/users/user-create.model.ts index 08be4db05..6677b42aa 100644 --- a/shared/models/users/user-create.model.ts +++ b/shared/models/users/user-create.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { UserRole } from './user-role' | 1 | import { UserRole } from './user-role' |
2 | import { UserAdminFlag } from './user-flag.model' | ||
2 | 3 | ||
3 | export interface UserCreate { | 4 | export interface UserCreate { |
4 | username: string | 5 | username: string |
@@ -7,4 +8,5 @@ export interface UserCreate { | |||
7 | videoQuota: number | 8 | videoQuota: number |
8 | videoQuotaDaily: number | 9 | videoQuotaDaily: number |
9 | role: UserRole | 10 | role: UserRole |
11 | adminFlags?: UserAdminFlag | ||
10 | } | 12 | } |
diff --git a/shared/models/users/user-flag.model.ts b/shared/models/users/user-flag.model.ts new file mode 100644 index 000000000..f5759f18f --- /dev/null +++ b/shared/models/users/user-flag.model.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export enum UserAdminFlag { | ||
2 | NONE = 0, | ||
3 | BY_PASS_VIDEO_AUTO_BLACKLIST = 1 << 0 | ||
4 | } | ||
diff --git a/shared/models/users/user-notification-setting.model.ts b/shared/models/users/user-notification-setting.model.ts index 531e12bba..e2a882b69 100644 --- a/shared/models/users/user-notification-setting.model.ts +++ b/shared/models/users/user-notification-setting.model.ts | |||
@@ -8,10 +8,12 @@ export interface UserNotificationSetting { | |||
8 | newVideoFromSubscription: UserNotificationSettingValue | 8 | newVideoFromSubscription: UserNotificationSettingValue |
9 | newCommentOnMyVideo: UserNotificationSettingValue | 9 | newCommentOnMyVideo: UserNotificationSettingValue |
10 | videoAbuseAsModerator: UserNotificationSettingValue | 10 | videoAbuseAsModerator: UserNotificationSettingValue |
11 | videoAutoBlacklistAsModerator: UserNotificationSettingValue | ||
11 | blacklistOnMyVideo: UserNotificationSettingValue | 12 | blacklistOnMyVideo: UserNotificationSettingValue |
12 | myVideoPublished: UserNotificationSettingValue | 13 | myVideoPublished: UserNotificationSettingValue |
13 | myVideoImportFinished: UserNotificationSettingValue | 14 | myVideoImportFinished: UserNotificationSettingValue |
14 | newUserRegistration: UserNotificationSettingValue | 15 | newUserRegistration: UserNotificationSettingValue |
15 | newFollow: UserNotificationSettingValue | 16 | newFollow: UserNotificationSettingValue |
16 | commentMention: UserNotificationSettingValue | 17 | commentMention: UserNotificationSettingValue |
18 | newInstanceFollower: UserNotificationSettingValue | ||
17 | } | 19 | } |
diff --git a/shared/models/users/user-notification.model.ts b/shared/models/users/user-notification.model.ts index 186b62612..fafc2b7d7 100644 --- a/shared/models/users/user-notification.model.ts +++ b/shared/models/users/user-notification.model.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | import { FollowState } from '../actors' | ||
2 | |||
1 | export enum UserNotificationType { | 3 | export enum UserNotificationType { |
2 | NEW_VIDEO_FROM_SUBSCRIPTION = 1, | 4 | NEW_VIDEO_FROM_SUBSCRIPTION = 1, |
3 | NEW_COMMENT_ON_MY_VIDEO = 2, | 5 | NEW_COMMENT_ON_MY_VIDEO = 2, |
@@ -13,7 +15,11 @@ export enum UserNotificationType { | |||
13 | 15 | ||
14 | NEW_USER_REGISTRATION = 9, | 16 | NEW_USER_REGISTRATION = 9, |
15 | NEW_FOLLOW = 10, | 17 | NEW_FOLLOW = 10, |
16 | COMMENT_MENTION = 11 | 18 | COMMENT_MENTION = 11, |
19 | |||
20 | VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12, | ||
21 | |||
22 | NEW_INSTANCE_FOLLOWER = 13 | ||
17 | } | 23 | } |
18 | 24 | ||
19 | export interface VideoInfo { | 25 | export interface VideoInfo { |
@@ -71,6 +77,7 @@ export interface UserNotification { | |||
71 | actorFollow?: { | 77 | actorFollow?: { |
72 | id: number | 78 | id: number |
73 | follower: ActorInfo | 79 | follower: ActorInfo |
80 | state: FollowState | ||
74 | following: { | 81 | following: { |
75 | type: 'account' | 'channel' | 82 | type: 'account' | 'channel' |
76 | name: string | 83 | name: string |
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts index 090256bca..71701bdb4 100644 --- a/shared/models/users/user-right.enum.ts +++ b/shared/models/users/user-right.enum.ts | |||
@@ -5,6 +5,10 @@ export enum UserRight { | |||
5 | 5 | ||
6 | MANAGE_SERVER_FOLLOW, | 6 | MANAGE_SERVER_FOLLOW, |
7 | 7 | ||
8 | MANAGE_LOGS, | ||
9 | |||
10 | MANAGE_DEBUG, | ||
11 | |||
8 | MANAGE_SERVER_REDUNDANCY, | 12 | MANAGE_SERVER_REDUNDANCY, |
9 | 13 | ||
10 | MANAGE_VIDEO_ABUSES, | 14 | MANAGE_VIDEO_ABUSES, |
@@ -20,8 +24,12 @@ export enum UserRight { | |||
20 | 24 | ||
21 | REMOVE_ANY_VIDEO, | 25 | REMOVE_ANY_VIDEO, |
22 | REMOVE_ANY_VIDEO_CHANNEL, | 26 | REMOVE_ANY_VIDEO_CHANNEL, |
27 | REMOVE_ANY_VIDEO_PLAYLIST, | ||
23 | REMOVE_ANY_VIDEO_COMMENT, | 28 | REMOVE_ANY_VIDEO_COMMENT, |
29 | |||
24 | UPDATE_ANY_VIDEO, | 30 | UPDATE_ANY_VIDEO, |
31 | UPDATE_ANY_VIDEO_PLAYLIST, | ||
32 | |||
25 | SEE_ALL_VIDEOS, | 33 | SEE_ALL_VIDEOS, |
26 | CHANGE_VIDEO_OWNERSHIP | 34 | CHANGE_VIDEO_OWNERSHIP |
27 | } | 35 | } |
diff --git a/shared/models/users/user-role.ts b/shared/models/users/user-role.ts index 59c2ba106..0b6554e51 100644 --- a/shared/models/users/user-role.ts +++ b/shared/models/users/user-role.ts | |||
@@ -25,6 +25,7 @@ const userRoleRights: { [ id: number ]: UserRight[] } = { | |||
25 | UserRight.MANAGE_VIDEO_ABUSES, | 25 | UserRight.MANAGE_VIDEO_ABUSES, |
26 | UserRight.REMOVE_ANY_VIDEO, | 26 | UserRight.REMOVE_ANY_VIDEO, |
27 | UserRight.REMOVE_ANY_VIDEO_CHANNEL, | 27 | UserRight.REMOVE_ANY_VIDEO_CHANNEL, |
28 | UserRight.REMOVE_ANY_VIDEO_PLAYLIST, | ||
28 | UserRight.REMOVE_ANY_VIDEO_COMMENT, | 29 | UserRight.REMOVE_ANY_VIDEO_COMMENT, |
29 | UserRight.UPDATE_ANY_VIDEO, | 30 | UserRight.UPDATE_ANY_VIDEO, |
30 | UserRight.SEE_ALL_VIDEOS, | 31 | UserRight.SEE_ALL_VIDEOS, |
diff --git a/shared/models/users/user-update.model.ts b/shared/models/users/user-update.model.ts index abde51321..fa43487ac 100644 --- a/shared/models/users/user-update.model.ts +++ b/shared/models/users/user-update.model.ts | |||
@@ -1,9 +1,12 @@ | |||
1 | import { UserRole } from './user-role' | 1 | import { UserRole } from './user-role' |
2 | import { UserAdminFlag } from './user-flag.model' | ||
2 | 3 | ||
3 | export interface UserUpdate { | 4 | export interface UserUpdate { |
5 | password?: string | ||
4 | email?: string | 6 | email?: string |
5 | emailVerified?: boolean | 7 | emailVerified?: boolean |
6 | videoQuota?: number | 8 | videoQuota?: number |
7 | videoQuotaDaily?: number | 9 | videoQuotaDaily?: number |
8 | role?: UserRole | 10 | role?: UserRole |
11 | adminFlags?: UserAdminFlag | ||
9 | } | 12 | } |
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts index af783d389..2f6a3c719 100644 --- a/shared/models/users/user.model.ts +++ b/shared/models/users/user.model.ts | |||
@@ -3,6 +3,7 @@ import { VideoChannel } from '../videos/channel/video-channel.model' | |||
3 | import { UserRole } from './user-role' | 3 | import { UserRole } from './user-role' |
4 | import { NSFWPolicyType } from '../videos/nsfw-policy.type' | 4 | import { NSFWPolicyType } from '../videos/nsfw-policy.type' |
5 | import { UserNotificationSetting } from './user-notification-setting.model' | 5 | import { UserNotificationSetting } from './user-notification-setting.model' |
6 | import { UserAdminFlag } from './user-flag.model' | ||
6 | 7 | ||
7 | export interface User { | 8 | export interface User { |
8 | id: number | 9 | id: number |
@@ -11,11 +12,15 @@ export interface User { | |||
11 | emailVerified: boolean | 12 | emailVerified: boolean |
12 | nsfwPolicy: NSFWPolicyType | 13 | nsfwPolicy: NSFWPolicyType |
13 | 14 | ||
15 | adminFlags?: UserAdminFlag | ||
16 | |||
14 | autoPlayVideo: boolean | 17 | autoPlayVideo: boolean |
15 | webTorrentEnabled: boolean | 18 | webTorrentEnabled: boolean |
16 | videosHistoryEnabled: boolean | 19 | videosHistoryEnabled: boolean |
17 | 20 | ||
18 | role: UserRole | 21 | role: UserRole |
22 | roleLabel: string | ||
23 | |||
19 | videoQuota: number | 24 | videoQuota: number |
20 | videoQuotaDaily: number | 25 | videoQuotaDaily: number |
21 | createdAt: Date | 26 | createdAt: Date |
diff --git a/shared/models/videos/blacklist/video-blacklist.model.ts b/shared/models/videos/blacklist/video-blacklist.model.ts index 4bd976190..68d59e489 100644 --- a/shared/models/videos/blacklist/video-blacklist.model.ts +++ b/shared/models/videos/blacklist/video-blacklist.model.ts | |||
@@ -1,19 +1,17 @@ | |||
1 | import { Video } from '../video.model' | ||
2 | |||
3 | export enum VideoBlacklistType { | ||
4 | MANUAL = 1, | ||
5 | AUTO_BEFORE_PUBLISHED = 2 | ||
6 | } | ||
7 | |||
1 | export interface VideoBlacklist { | 8 | export interface VideoBlacklist { |
2 | id: number | 9 | id: number |
3 | createdAt: Date | 10 | createdAt: Date |
4 | updatedAt: Date | 11 | updatedAt: Date |
5 | unfederated: boolean | 12 | unfederated: boolean |
6 | reason?: string | 13 | reason?: string |
14 | type: VideoBlacklistType | ||
7 | 15 | ||
8 | video: { | 16 | video: Video |
9 | id: number | ||
10 | name: string | ||
11 | uuid: string | ||
12 | description: string | ||
13 | duration: number | ||
14 | views: number | ||
15 | likes: number | ||
16 | dislikes: number | ||
17 | nsfw: boolean | ||
18 | } | ||
19 | } | 17 | } |
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/import/video-import.model.ts b/shared/models/videos/import/video-import.model.ts index e2a56617d..92856c70f 100644 --- a/shared/models/videos/import/video-import.model.ts +++ b/shared/models/videos/import/video-import.model.ts | |||
@@ -11,6 +11,7 @@ export interface VideoImport { | |||
11 | 11 | ||
12 | createdAt: string | 12 | createdAt: string |
13 | updatedAt: string | 13 | updatedAt: string |
14 | originallyPublishedAt?: string | ||
14 | state: VideoConstant<VideoImportState> | 15 | state: VideoConstant<VideoImportState> |
15 | error?: string | 16 | error?: string |
16 | 17 | ||
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index 056ae06da..e3d78220e 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | export * from './rate/user-video-rate-update.model' | 1 | export * from './rate/user-video-rate-update.model' |
2 | export * from './rate/user-video-rate.model' | 2 | export * from './rate/user-video-rate.model' |
3 | export * from './rate/account-video-rate.model' | ||
3 | export * from './rate/user-video-rate.type' | 4 | export * from './rate/user-video-rate.type' |
4 | export * from './abuse/video-abuse-state.model' | 5 | export * from './abuse/video-abuse-state.model' |
5 | export * from './abuse/video-abuse-create.model' | 6 | export * from './abuse/video-abuse-create.model' |
@@ -11,6 +12,13 @@ export * from './blacklist/video-blacklist-update.model' | |||
11 | export * from './channel/video-channel-create.model' | 12 | export * from './channel/video-channel-create.model' |
12 | export * from './channel/video-channel-update.model' | 13 | export * from './channel/video-channel-update.model' |
13 | export * from './channel/video-channel.model' | 14 | export * from './channel/video-channel.model' |
15 | export * from './playlist/video-playlist-create.model' | ||
16 | export * from './playlist/video-playlist-element-create.model' | ||
17 | export * from './playlist/video-playlist-element-update.model' | ||
18 | export * from './playlist/video-playlist-privacy.model' | ||
19 | export * from './playlist/video-playlist-type.model' | ||
20 | export * from './playlist/video-playlist-update.model' | ||
21 | export * from './playlist/video-playlist.model' | ||
14 | export * from './video-change-ownership.model' | 22 | export * from './video-change-ownership.model' |
15 | export * from './video-change-ownership-create.model' | 23 | export * from './video-change-ownership-create.model' |
16 | export * from './video-create.model' | 24 | export * from './video-create.model' |
@@ -27,4 +35,4 @@ export * from './caption/video-caption-update.model' | |||
27 | export * from './import/video-import-create.model' | 35 | export * from './import/video-import-create.model' |
28 | export * from './import/video-import-state.enum' | 36 | export * from './import/video-import-state.enum' |
29 | export * from './import/video-import.model' | 37 | export * from './import/video-import.model' |
30 | export { VideoConstant } from './video-constant.model' | 38 | export * from './video-constant.model' |
diff --git a/shared/models/videos/playlist/video-exist-in-playlist.model.ts b/shared/models/videos/playlist/video-exist-in-playlist.model.ts new file mode 100644 index 000000000..71240f51d --- /dev/null +++ b/shared/models/videos/playlist/video-exist-in-playlist.model.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | export type VideoExistInPlaylist = { | ||
2 | [videoId: number ]: { | ||
3 | playlistId: number | ||
4 | startTimestamp?: number | ||
5 | stopTimestamp?: number | ||
6 | }[] | ||
7 | } | ||
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..67a33fa35 --- /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 | privacy: VideoPlaylistPrivacy | ||
6 | |||
7 | description?: string | ||
8 | videoChannelId?: number | ||
9 | |||
10 | thumbnailfile?: any | ||
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..c31702892 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-element-create.model.ts | |||
@@ -0,0 +1,6 @@ | |||
1 | export interface VideoPlaylistElementCreate { | ||
2 | videoId: number | ||
3 | |||
4 | startTimestamp?: number | ||
5 | stopTimestamp?: number | ||
6 | } | ||
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-reorder.model.ts b/shared/models/videos/playlist/video-playlist-reorder.model.ts new file mode 100644 index 000000000..63ec714c5 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-reorder.model.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface VideoPlaylistReorder { | ||
2 | startPosition: number | ||
3 | insertAfterPosition: number | ||
4 | reorderLength?: number | ||
5 | } | ||
diff --git a/shared/models/videos/playlist/video-playlist-type.model.ts b/shared/models/videos/playlist/video-playlist-type.model.ts new file mode 100644 index 000000000..49233b743 --- /dev/null +++ b/shared/models/videos/playlist/video-playlist-type.model.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export enum VideoPlaylistType { | ||
2 | REGULAR = 1, | ||
3 | WATCH_LATER = 2 | ||
4 | } | ||
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..0ff5bcb0f --- /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 | privacy: VideoPlaylistPrivacy | ||
6 | |||
7 | description?: string | ||
8 | videoChannelId?: number | ||
9 | thumbnailfile?: any | ||
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..c0941727a --- /dev/null +++ b/shared/models/videos/playlist/video-playlist.model.ts | |||
@@ -0,0 +1,26 @@ | |||
1 | import { AccountSummary } from '../../actors/index' | ||
2 | import { VideoChannelSummary, VideoConstant } from '..' | ||
3 | import { VideoPlaylistPrivacy } from './video-playlist-privacy.model' | ||
4 | import { VideoPlaylistType } from './video-playlist-type.model' | ||
5 | |||
6 | export interface VideoPlaylist { | ||
7 | id: number | ||
8 | uuid: string | ||
9 | isLocal: boolean | ||
10 | |||
11 | displayName: string | ||
12 | description: string | ||
13 | privacy: VideoConstant<VideoPlaylistPrivacy> | ||
14 | |||
15 | thumbnailPath: string | ||
16 | |||
17 | videosLength: number | ||
18 | |||
19 | type: VideoConstant<VideoPlaylistType> | ||
20 | |||
21 | createdAt: Date | string | ||
22 | updatedAt: Date | string | ||
23 | |||
24 | ownerAccount: AccountSummary | ||
25 | videoChannel?: VideoChannelSummary | ||
26 | } | ||
diff --git a/shared/models/videos/rate/account-video-rate.model.ts b/shared/models/videos/rate/account-video-rate.model.ts new file mode 100644 index 000000000..e789367dc --- /dev/null +++ b/shared/models/videos/rate/account-video-rate.model.ts | |||
@@ -0,0 +1,7 @@ | |||
1 | import { UserVideoRateType } from './user-video-rate.type' | ||
2 | import { Video } from '../video.model' | ||
3 | |||
4 | export interface AccountVideoRate { | ||
5 | video: Video | ||
6 | rating: UserVideoRateType | ||
7 | } | ||
diff --git a/shared/models/videos/thumbnail.type.ts b/shared/models/videos/thumbnail.type.ts new file mode 100644 index 000000000..d6c2bef7b --- /dev/null +++ b/shared/models/videos/thumbnail.type.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export enum ThumbnailType { | ||
2 | MINIATURE = 1, | ||
3 | PREVIEW = 2 | ||
4 | } | ||
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts index 190d63783..53631bf79 100644 --- a/shared/models/videos/video-create.model.ts +++ b/shared/models/videos/video-create.model.ts | |||
@@ -13,6 +13,8 @@ export interface VideoCreate { | |||
13 | name: string | 13 | name: string |
14 | tags?: string[] | 14 | tags?: string[] |
15 | commentsEnabled?: boolean | 15 | commentsEnabled?: boolean |
16 | downloadEnabled?: boolean | ||
16 | privacy: VideoPrivacy | 17 | privacy: VideoPrivacy |
17 | scheduleUpdate?: VideoScheduleUpdate | 18 | scheduleUpdate?: VideoScheduleUpdate |
19 | originallyPublishedAt: Date | string | ||
18 | } | 20 | } |
diff --git a/shared/models/videos/video-streaming-playlist.model.ts b/shared/models/videos/video-streaming-playlist.model.ts new file mode 100644 index 000000000..17f8fe865 --- /dev/null +++ b/shared/models/videos/video-streaming-playlist.model.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import { VideoStreamingPlaylistType } from './video-streaming-playlist.type' | ||
2 | |||
3 | export class VideoStreamingPlaylist { | ||
4 | id: number | ||
5 | type: VideoStreamingPlaylistType | ||
6 | playlistUrl: string | ||
7 | segmentsSha256Url: string | ||
8 | |||
9 | redundancies: { | ||
10 | baseUrl: string | ||
11 | }[] | ||
12 | } | ||
diff --git a/shared/models/videos/video-streaming-playlist.type.ts b/shared/models/videos/video-streaming-playlist.type.ts new file mode 100644 index 000000000..3b403f295 --- /dev/null +++ b/shared/models/videos/video-streaming-playlist.type.ts | |||
@@ -0,0 +1,3 @@ | |||
1 | export enum VideoStreamingPlaylistType { | ||
2 | HLS = 1 | ||
3 | } | ||
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts index ed141a824..4ef904156 100644 --- a/shared/models/videos/video-update.model.ts +++ b/shared/models/videos/video-update.model.ts | |||
@@ -11,10 +11,12 @@ export interface VideoUpdate { | |||
11 | privacy?: VideoPrivacy | 11 | privacy?: VideoPrivacy |
12 | tags?: string[] | 12 | tags?: string[] |
13 | commentsEnabled?: boolean | 13 | commentsEnabled?: boolean |
14 | downloadEnabled?: boolean | ||
14 | nsfw?: boolean | 15 | nsfw?: boolean |
15 | waitTranscoding?: boolean | 16 | waitTranscoding?: boolean |
16 | channelId?: number | 17 | channelId?: number |
17 | thumbnailfile?: Blob | 18 | thumbnailfile?: Blob |
18 | previewfile?: Blob | 19 | previewfile?: Blob |
19 | scheduleUpdate?: VideoScheduleUpdate | 20 | scheduleUpdate?: VideoScheduleUpdate |
21 | originallyPublishedAt?: Date | string | ||
20 | } | 22 | } |
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 022876a0b..963268674 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts | |||
@@ -1,10 +1,11 @@ | |||
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' |
5 | import { VideoPrivacy } from './video-privacy.enum' | 5 | import { VideoPrivacy } from './video-privacy.enum' |
6 | import { VideoScheduleUpdate } from './video-schedule-update.model' | 6 | import { VideoScheduleUpdate } from './video-schedule-update.model' |
7 | import { VideoConstant } from './video-constant.model' | 7 | import { VideoConstant } from './video-constant.model' |
8 | import { VideoStreamingPlaylist } from './video-streaming-playlist.model' | ||
8 | 9 | ||
9 | export interface VideoFile { | 10 | export interface VideoFile { |
10 | magnetUri: string | 11 | magnetUri: string |
@@ -17,24 +18,10 @@ export interface VideoFile { | |||
17 | fps: number | 18 | fps: number |
18 | } | 19 | } |
19 | 20 | ||
20 | export interface VideoChannelAttribute { | 21 | export interface PlaylistElement { |
21 | id: number | 22 | position: number |
22 | uuid: string | 23 | startTimestamp: number |
23 | name: string | 24 | stopTimestamp: number |
24 | displayName: string | ||
25 | url: string | ||
26 | host: string | ||
27 | avatar?: Avatar | ||
28 | } | ||
29 | |||
30 | export interface AccountAttribute { | ||
31 | id: number | ||
32 | uuid: string | ||
33 | name: string | ||
34 | displayName: string | ||
35 | url: string | ||
36 | host: string | ||
37 | avatar?: Avatar | ||
38 | } | 25 | } |
39 | 26 | ||
40 | export interface Video { | 27 | export interface Video { |
@@ -43,6 +30,7 @@ export interface Video { | |||
43 | createdAt: Date | string | 30 | createdAt: Date | string |
44 | updatedAt: Date | string | 31 | updatedAt: Date | string |
45 | publishedAt: Date | string | 32 | publishedAt: Date | string |
33 | originallyPublishedAt: Date | string | ||
46 | category: VideoConstant<number> | 34 | category: VideoConstant<number> |
47 | licence: VideoConstant<number> | 35 | licence: VideoConstant<number> |
48 | language: VideoConstant<string> | 36 | language: VideoConstant<string> |
@@ -66,12 +54,14 @@ export interface Video { | |||
66 | blacklisted?: boolean | 54 | blacklisted?: boolean |
67 | blacklistedReason?: string | 55 | blacklistedReason?: string |
68 | 56 | ||
69 | account: AccountAttribute | 57 | account: AccountSummary |
70 | channel: VideoChannelAttribute | 58 | channel: VideoChannelSummary |
71 | 59 | ||
72 | userHistory?: { | 60 | userHistory?: { |
73 | currentTime: number | 61 | currentTime: number |
74 | } | 62 | } |
63 | |||
64 | playlistElement?: PlaylistElement | ||
75 | } | 65 | } |
76 | 66 | ||
77 | export interface VideoDetails extends Video { | 67 | export interface VideoDetails extends Video { |
@@ -82,8 +72,13 @@ export interface VideoDetails extends Video { | |||
82 | files: VideoFile[] | 72 | files: VideoFile[] |
83 | account: Account | 73 | account: Account |
84 | commentsEnabled: boolean | 74 | commentsEnabled: boolean |
75 | downloadEnabled: boolean | ||
85 | 76 | ||
86 | // Not optional in details (unlike in Video) | 77 | // Not optional in details (unlike in Video) |
87 | waitTranscoding: boolean | 78 | waitTranscoding: boolean |
88 | state: VideoConstant<VideoState> | 79 | state: VideoConstant<VideoState> |
80 | |||
81 | trackerUrls: string[] | ||
82 | |||
83 | streamingPlaylists: VideoStreamingPlaylist[] | ||
89 | } | 84 | } |