diff options
Diffstat (limited to 'shared/models/videos')
-rw-r--r-- | shared/models/videos/abuse/video-abuse-video-is.type.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/abuse/video-abuse.model.ts | 13 | ||||
-rw-r--r-- | shared/models/videos/blacklist/video-blacklist.model.ts | 5 | ||||
-rw-r--r-- | shared/models/videos/channel/video-channel.model.ts | 6 | ||||
-rw-r--r-- | shared/models/videos/video-file-metadata.ts | 18 | ||||
-rw-r--r-- | shared/models/videos/video-file.model.ts | 3 | ||||
-rw-r--r-- | shared/models/videos/video-transcoding-fps.model.ts | 8 | ||||
-rw-r--r-- | shared/models/videos/video.model.ts | 2 |
8 files changed, 50 insertions, 6 deletions
diff --git a/shared/models/videos/abuse/video-abuse-video-is.type.ts b/shared/models/videos/abuse/video-abuse-video-is.type.ts new file mode 100644 index 000000000..e86018993 --- /dev/null +++ b/shared/models/videos/abuse/video-abuse-video-is.type.ts | |||
@@ -0,0 +1 @@ | |||
export type VideoAbuseVideoIs = 'deleted' | 'blacklisted' | |||
diff --git a/shared/models/videos/abuse/video-abuse.model.ts b/shared/models/videos/abuse/video-abuse.model.ts index 4f668795a..f2c2cdc41 100644 --- a/shared/models/videos/abuse/video-abuse.model.ts +++ b/shared/models/videos/abuse/video-abuse.model.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { Account } from '../../actors/index' | 1 | import { Account } from '../../actors/index' |
2 | import { VideoConstant } from '../video-constant.model' | 2 | import { VideoConstant } from '../video-constant.model' |
3 | import { VideoAbuseState } from './video-abuse-state.model' | 3 | import { VideoAbuseState } from './video-abuse-state.model' |
4 | import { VideoChannel } from '../channel/video-channel.model' | ||
4 | 5 | ||
5 | export interface VideoAbuse { | 6 | export interface VideoAbuse { |
6 | id: number | 7 | id: number |
@@ -14,7 +15,19 @@ export interface VideoAbuse { | |||
14 | id: number | 15 | id: number |
15 | name: string | 16 | name: string |
16 | uuid: string | 17 | uuid: string |
18 | nsfw: boolean | ||
19 | deleted: boolean | ||
20 | blacklisted: boolean | ||
21 | thumbnailPath?: string | ||
22 | channel?: VideoChannel | ||
17 | } | 23 | } |
18 | 24 | ||
19 | createdAt: Date | 25 | createdAt: Date |
26 | updatedAt: Date | ||
27 | |||
28 | count?: number | ||
29 | nth?: number | ||
30 | |||
31 | countReportsForReporter?: number | ||
32 | countReportsForReportee?: number | ||
20 | } | 33 | } |
diff --git a/shared/models/videos/blacklist/video-blacklist.model.ts b/shared/models/videos/blacklist/video-blacklist.model.ts index 68d59e489..a6e0ef175 100644 --- a/shared/models/videos/blacklist/video-blacklist.model.ts +++ b/shared/models/videos/blacklist/video-blacklist.model.ts | |||
@@ -7,11 +7,12 @@ export enum VideoBlacklistType { | |||
7 | 7 | ||
8 | export interface VideoBlacklist { | 8 | export interface VideoBlacklist { |
9 | id: number | 9 | id: number |
10 | createdAt: Date | ||
11 | updatedAt: Date | ||
12 | unfederated: boolean | 10 | unfederated: boolean |
13 | reason?: string | 11 | reason?: string |
14 | type: VideoBlacklistType | 12 | type: VideoBlacklistType |
15 | 13 | ||
16 | video: Video | 14 | video: Video |
15 | |||
16 | createdAt: Date | ||
17 | updatedAt: Date | ||
17 | } | 18 | } |
diff --git a/shared/models/videos/channel/video-channel.model.ts b/shared/models/videos/channel/video-channel.model.ts index de4c26b3d..421004e68 100644 --- a/shared/models/videos/channel/video-channel.model.ts +++ b/shared/models/videos/channel/video-channel.model.ts | |||
@@ -2,12 +2,18 @@ import { Actor } from '../../actors/actor.model' | |||
2 | import { Account } from '../../actors/index' | 2 | import { Account } from '../../actors/index' |
3 | import { Avatar } from '../../avatars' | 3 | import { Avatar } from '../../avatars' |
4 | 4 | ||
5 | export type ViewsPerDate = { | ||
6 | date: Date | ||
7 | views: number | ||
8 | } | ||
9 | |||
5 | export interface VideoChannel extends Actor { | 10 | export interface VideoChannel extends Actor { |
6 | displayName: string | 11 | displayName: string |
7 | description: string | 12 | description: string |
8 | support: string | 13 | support: string |
9 | isLocal: boolean | 14 | isLocal: boolean |
10 | ownerAccount?: Account | 15 | ownerAccount?: Account |
16 | viewsPerDay?: ViewsPerDate[] // chronologically ordered | ||
11 | } | 17 | } |
12 | 18 | ||
13 | export interface VideoChannelSummary { | 19 | export interface VideoChannelSummary { |
diff --git a/shared/models/videos/video-file-metadata.ts b/shared/models/videos/video-file-metadata.ts new file mode 100644 index 000000000..15683cacf --- /dev/null +++ b/shared/models/videos/video-file-metadata.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { FfprobeData } from "fluent-ffmpeg" | ||
2 | import { DeepOmit } from "@server/models/utils" | ||
3 | |||
4 | export type VideoFileMetadataModel = DeepOmit<FfprobeData, 'filename'> | ||
5 | |||
6 | export class VideoFileMetadata implements VideoFileMetadataModel { | ||
7 | streams: { [x: string]: any, [x: number]: any }[] | ||
8 | format: { [x: string]: any, [x: number]: any } | ||
9 | chapters: any[] | ||
10 | |||
11 | constructor (hash: Partial<VideoFileMetadataModel>) { | ||
12 | this.chapters = hash.chapters | ||
13 | this.format = hash.format | ||
14 | this.streams = hash.streams | ||
15 | |||
16 | delete this.format.filename | ||
17 | } | ||
18 | } | ||
diff --git a/shared/models/videos/video-file.model.ts b/shared/models/videos/video-file.model.ts index 04da0627e..6cc2d5aee 100644 --- a/shared/models/videos/video-file.model.ts +++ b/shared/models/videos/video-file.model.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { VideoConstant, VideoResolution } from '@shared/models' | 1 | import { VideoConstant, VideoResolution } from '@shared/models' |
2 | import { FfprobeData } from 'fluent-ffmpeg' | ||
2 | 3 | ||
3 | export interface VideoFile { | 4 | export interface VideoFile { |
4 | magnetUri: string | 5 | magnetUri: string |
@@ -9,4 +10,6 @@ export interface VideoFile { | |||
9 | fileUrl: string | 10 | fileUrl: string |
10 | fileDownloadUrl: string | 11 | fileDownloadUrl: string |
11 | fps: number | 12 | fps: number |
13 | metadata?: FfprobeData | ||
14 | metadataUrl?: string | ||
12 | } | 15 | } |
diff --git a/shared/models/videos/video-transcoding-fps.model.ts b/shared/models/videos/video-transcoding-fps.model.ts index 82022d2f1..25fc1c2da 100644 --- a/shared/models/videos/video-transcoding-fps.model.ts +++ b/shared/models/videos/video-transcoding-fps.model.ts | |||
@@ -1,6 +1,8 @@ | |||
1 | export type VideoTranscodingFPS = { | 1 | export type VideoTranscodingFPS = { |
2 | MIN: number, | 2 | MIN: number |
3 | AVERAGE: number, | 3 | STANDARD: number[] |
4 | MAX: number, | 4 | HD_STANDARD: number[] |
5 | AVERAGE: number | ||
6 | MAX: number | ||
5 | KEEP_ORIGIN_FPS_RESOLUTION_MIN: number | 7 | KEEP_ORIGIN_FPS_RESOLUTION_MIN: number |
6 | } | 8 | } |
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 7576439fe..a69152759 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index' | 1 | import { AccountSummary, VideoChannelSummary, VideoState } from '../../index' |
2 | import { Account } from '../actors' | 2 | import { Account } from '../actors' |
3 | import { VideoChannel } from './channel/video-channel.model' | 3 | import { VideoChannel } from './channel/video-channel.model' |
4 | import { VideoPrivacy } from './video-privacy.enum' | 4 | import { VideoPrivacy } from './video-privacy.enum' |