aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/activitypub/objects/common-objects.ts2
-rw-r--r--shared/models/i18n/i18n.ts11
-rw-r--r--shared/models/server/custom-config.model.ts8
-rw-r--r--shared/models/server/job.model.ts3
-rw-r--r--shared/models/server/server-config.model.ts8
-rw-r--r--shared/models/videos/index.ts3
-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.model.ts14
-rw-r--r--shared/models/videos/video-state.enum.ts3
10 files changed, 58 insertions, 5 deletions
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index 3127d0565..5b2b3adae 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -22,7 +22,9 @@ export interface ActivityUrlObject {
22 mimeType: 'video/mp4' | 'video/webm' | 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' 22 mimeType: 'video/mp4' | 'video/webm' | 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
23 href: string 23 href: string
24 width: number 24 width: number
25
25 size?: number 26 size?: number
27 fps?: number
26} 28}
27 29
28export interface ActivityPubAttributedTo { 30export interface ActivityPubAttributedTo {
diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.ts
index 3f2ca4eaf..baf3fa0f4 100644
--- a/shared/models/i18n/i18n.ts
+++ b/shared/models/i18n/i18n.ts
@@ -6,7 +6,10 @@ export const I18N_LOCALES = {
6 'eu-ES': 'euskara', 6 'eu-ES': 'euskara',
7 'ca-ES': 'català', 7 'ca-ES': 'català',
8 'cs-CZ': 'čeština', 8 'cs-CZ': 'čeština',
9 'eo': 'Esperanto' 9 'eo': 'Esperanto',
10 'de-DE': 'Deutsch',
11 'es-ES': 'español',
12 'zh-Hant-TW': '中文 (繁體, 台灣)'
10 // 'pl-PL': 'polski' 13 // 'pl-PL': 'polski'
11} 14}
12 15
@@ -15,7 +18,9 @@ const I18N_LOCALE_ALIAS = {
15 'fr': 'fr-FR', 18 'fr': 'fr-FR',
16 'eu': 'eu-ES', 19 'eu': 'eu-ES',
17 'ca': 'ca-ES', 20 'ca': 'ca-ES',
18 'cs': 'cs-CZ' 21 'cs': 'cs-CZ',
22 'de': 'de-DE',
23 'es': 'es-ES'
19 // 'pl': 'pl-PL' 24 // 'pl': 'pl-PL'
20} 25}
21 26
@@ -56,5 +61,5 @@ export function getShortLocale (locale: string) {
56export function buildFileLocale (locale: string) { 61export function buildFileLocale (locale: string) {
57 const completeLocale = getCompleteLocale(locale) 62 const completeLocale = getCompleteLocale(locale)
58 63
59 return completeLocale.replace('-', '_') 64 return completeLocale.replace(/-/g, '_')
60} 65}
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
index 9c4718e43..46320435d 100644
--- a/shared/models/server/custom-config.model.ts
+++ b/shared/models/server/custom-config.model.ts
@@ -55,4 +55,12 @@ export interface CustomConfig {
55 '1080p': boolean 55 '1080p': boolean
56 } 56 }
57 } 57 }
58
59 import: {
60 videos: {
61 http: {
62 enabled: boolean
63 }
64 }
65 }
58} 66}
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/server/server-config.model.ts b/shared/models/server/server-config.model.ts
index 217d142cd..2cafedbbc 100644
--- a/shared/models/server/server-config.model.ts
+++ b/shared/models/server/server-config.model.ts
@@ -23,6 +23,14 @@ export interface ServerConfig {
23 enabledResolutions: number[] 23 enabledResolutions: number[]
24 } 24 }
25 25
26 import: {
27 videos: {
28 http: {
29 enabled: boolean
30 }
31 }
32 }
33
26 avatar: { 34 avatar: {
27 file: { 35 file: {
28 size: { 36 size: {
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
index cb9669772..17cf8be24 100644
--- a/shared/models/videos/index.ts
+++ b/shared/models/videos/index.ts
@@ -15,4 +15,7 @@ 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-state.enum'
20export * from './video-import.model'
18export { VideoConstant } from './video-constant.model' 21export { 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.model.ts b/shared/models/videos/video-import.model.ts
new file mode 100644
index 000000000..a5c582c67
--- /dev/null
+++ b/shared/models/videos/video-import.model.ts
@@ -0,0 +1,14 @@
1import { Video } from './video.model'
2import { VideoConstant } from './video-constant.model'
3import { VideoImportState } from './video-import-state.enum'
4
5export interface VideoImport {
6 id: number
7 targetUrl: string
8 createdAt: string
9 updatedAt: string
10 state: VideoConstant<VideoImportState>
11 error?: string
12
13 video?: Video & { tags: string[] }
14}
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}