aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/videos
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-06-22 13:00:39 +0200
committerGitHub <noreply@github.com>2020-06-22 13:00:39 +0200
commit1ebddadd0704812a4600c39cabe2268321e88331 (patch)
tree1cc8560e5b63e9976aa5411ba800a62cfe7b8ea9 /shared/models/videos
parent07aea1a2642fc9868cb01e30c322514029d5b95a (diff)
downloadPeerTube-1ebddadd0704812a4600c39cabe2268321e88331.tar.gz
PeerTube-1ebddadd0704812a4600c39cabe2268321e88331.tar.zst
PeerTube-1ebddadd0704812a4600c39cabe2268321e88331.zip
predefined report reasons & improved reporter UI (#2842)
- added `startAt` and `endAt` optional timestamps to help pin down reported sections of a video - added predefined report reasons - added video player with report modal
Diffstat (limited to 'shared/models/videos')
-rw-r--r--shared/models/videos/abuse/video-abuse-create.model.ts5
-rw-r--r--shared/models/videos/abuse/video-abuse-reason.model.ts33
-rw-r--r--shared/models/videos/abuse/video-abuse.model.ts5
-rw-r--r--shared/models/videos/index.ts1
4 files changed, 44 insertions, 0 deletions
diff --git a/shared/models/videos/abuse/video-abuse-create.model.ts b/shared/models/videos/abuse/video-abuse-create.model.ts
index db6458275..c93cb8b2c 100644
--- a/shared/models/videos/abuse/video-abuse-create.model.ts
+++ b/shared/models/videos/abuse/video-abuse-create.model.ts
@@ -1,3 +1,8 @@
1import { VideoAbusePredefinedReasonsString } from './video-abuse-reason.model'
2
1export interface VideoAbuseCreate { 3export interface VideoAbuseCreate {
2 reason: string 4 reason: string
5 predefinedReasons?: VideoAbusePredefinedReasonsString[]
6 startAt?: number
7 endAt?: number
3} 8}
diff --git a/shared/models/videos/abuse/video-abuse-reason.model.ts b/shared/models/videos/abuse/video-abuse-reason.model.ts
new file mode 100644
index 000000000..9064f0c1a
--- /dev/null
+++ b/shared/models/videos/abuse/video-abuse-reason.model.ts
@@ -0,0 +1,33 @@
1export enum VideoAbusePredefinedReasons {
2 VIOLENT_OR_REPULSIVE = 1,
3 HATEFUL_OR_ABUSIVE,
4 SPAM_OR_MISLEADING,
5 PRIVACY,
6 RIGHTS,
7 SERVER_RULES,
8 THUMBNAILS,
9 CAPTIONS
10}
11
12export type VideoAbusePredefinedReasonsString =
13 'violentOrRepulsive' |
14 'hatefulOrAbusive' |
15 'spamOrMisleading' |
16 'privacy' |
17 'rights' |
18 'serverRules' |
19 'thumbnails' |
20 'captions'
21
22export const videoAbusePredefinedReasonsMap: {
23 [key in VideoAbusePredefinedReasonsString]: VideoAbusePredefinedReasons
24} = {
25 violentOrRepulsive: VideoAbusePredefinedReasons.VIOLENT_OR_REPULSIVE,
26 hatefulOrAbusive: VideoAbusePredefinedReasons.HATEFUL_OR_ABUSIVE,
27 spamOrMisleading: VideoAbusePredefinedReasons.SPAM_OR_MISLEADING,
28 privacy: VideoAbusePredefinedReasons.PRIVACY,
29 rights: VideoAbusePredefinedReasons.RIGHTS,
30 serverRules: VideoAbusePredefinedReasons.SERVER_RULES,
31 thumbnails: VideoAbusePredefinedReasons.THUMBNAILS,
32 captions: VideoAbusePredefinedReasons.CAPTIONS
33}
diff --git a/shared/models/videos/abuse/video-abuse.model.ts b/shared/models/videos/abuse/video-abuse.model.ts
index f2c2cdc41..38605dcac 100644
--- a/shared/models/videos/abuse/video-abuse.model.ts
+++ b/shared/models/videos/abuse/video-abuse.model.ts
@@ -2,10 +2,12 @@ import { Account } from '../../actors/index'
2import { VideoConstant } from '../video-constant.model' 2import { VideoConstant } from '../video-constant.model'
3import { VideoAbuseState } from './video-abuse-state.model' 3import { VideoAbuseState } from './video-abuse-state.model'
4import { VideoChannel } from '../channel/video-channel.model' 4import { VideoChannel } from '../channel/video-channel.model'
5import { VideoAbusePredefinedReasonsString } from './video-abuse-reason.model'
5 6
6export interface VideoAbuse { 7export interface VideoAbuse {
7 id: number 8 id: number
8 reason: string 9 reason: string
10 predefinedReasons?: VideoAbusePredefinedReasonsString[]
9 reporterAccount: Account 11 reporterAccount: Account
10 12
11 state: VideoConstant<VideoAbuseState> 13 state: VideoConstant<VideoAbuseState>
@@ -25,6 +27,9 @@ export interface VideoAbuse {
25 createdAt: Date 27 createdAt: Date
26 updatedAt: Date 28 updatedAt: Date
27 29
30 startAt: number
31 endAt: number
32
28 count?: number 33 count?: number
29 nth?: number 34 nth?: number
30 35
diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts
index 51ccb9fbd..58bd1ebd7 100644
--- a/shared/models/videos/index.ts
+++ b/shared/models/videos/index.ts
@@ -4,6 +4,7 @@ export * from './rate/account-video-rate.model'
4export * from './rate/user-video-rate.type' 4export * from './rate/user-video-rate.type'
5export * from './abuse/video-abuse-state.model' 5export * from './abuse/video-abuse-state.model'
6export * from './abuse/video-abuse-create.model' 6export * from './abuse/video-abuse-create.model'
7export * from './abuse/video-abuse-reason.model'
7export * from './abuse/video-abuse.model' 8export * from './abuse/video-abuse.model'
8export * from './abuse/video-abuse-update.model' 9export * from './abuse/video-abuse-update.model'
9export * from './blacklist/video-blacklist.model' 10export * from './blacklist/video-blacklist.model'