From d95d15598847c7f020aa056e7e6e0c02d2bbf732 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 1 Jul 2020 16:05:30 +0200 Subject: Use 3 tables to represent abuses --- shared/models/videos/abuse/index.ts | 6 ---- .../videos/abuse/video-abuse-create.model.ts | 8 ----- .../videos/abuse/video-abuse-reason.model.ts | 33 ------------------- .../models/videos/abuse/video-abuse-state.model.ts | 5 --- .../videos/abuse/video-abuse-update.model.ts | 6 ---- .../videos/abuse/video-abuse-video-is.type.ts | 1 - shared/models/videos/abuse/video-abuse.model.ts | 38 ---------------------- shared/models/videos/index.ts | 1 - 8 files changed, 98 deletions(-) delete mode 100644 shared/models/videos/abuse/index.ts delete mode 100644 shared/models/videos/abuse/video-abuse-create.model.ts delete mode 100644 shared/models/videos/abuse/video-abuse-reason.model.ts delete mode 100644 shared/models/videos/abuse/video-abuse-state.model.ts delete mode 100644 shared/models/videos/abuse/video-abuse-update.model.ts delete mode 100644 shared/models/videos/abuse/video-abuse-video-is.type.ts delete mode 100644 shared/models/videos/abuse/video-abuse.model.ts (limited to 'shared/models/videos') diff --git a/shared/models/videos/abuse/index.ts b/shared/models/videos/abuse/index.ts deleted file mode 100644 index f70bc736f..000000000 --- a/shared/models/videos/abuse/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './video-abuse-create.model' -export * from './video-abuse-reason.model' -export * from './video-abuse-state.model' -export * from './video-abuse-update.model' -export * from './video-abuse-video-is.type' -export * from './video-abuse.model' diff --git a/shared/models/videos/abuse/video-abuse-create.model.ts b/shared/models/videos/abuse/video-abuse-create.model.ts deleted file mode 100644 index c93cb8b2c..000000000 --- a/shared/models/videos/abuse/video-abuse-create.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { VideoAbusePredefinedReasonsString } from './video-abuse-reason.model' - -export interface VideoAbuseCreate { - reason: string - predefinedReasons?: VideoAbusePredefinedReasonsString[] - startAt?: number - endAt?: number -} diff --git a/shared/models/videos/abuse/video-abuse-reason.model.ts b/shared/models/videos/abuse/video-abuse-reason.model.ts deleted file mode 100644 index 9064f0c1a..000000000 --- a/shared/models/videos/abuse/video-abuse-reason.model.ts +++ /dev/null @@ -1,33 +0,0 @@ -export enum VideoAbusePredefinedReasons { - VIOLENT_OR_REPULSIVE = 1, - HATEFUL_OR_ABUSIVE, - SPAM_OR_MISLEADING, - PRIVACY, - RIGHTS, - SERVER_RULES, - THUMBNAILS, - CAPTIONS -} - -export type VideoAbusePredefinedReasonsString = - 'violentOrRepulsive' | - 'hatefulOrAbusive' | - 'spamOrMisleading' | - 'privacy' | - 'rights' | - 'serverRules' | - 'thumbnails' | - 'captions' - -export const videoAbusePredefinedReasonsMap: { - [key in VideoAbusePredefinedReasonsString]: VideoAbusePredefinedReasons -} = { - violentOrRepulsive: VideoAbusePredefinedReasons.VIOLENT_OR_REPULSIVE, - hatefulOrAbusive: VideoAbusePredefinedReasons.HATEFUL_OR_ABUSIVE, - spamOrMisleading: VideoAbusePredefinedReasons.SPAM_OR_MISLEADING, - privacy: VideoAbusePredefinedReasons.PRIVACY, - rights: VideoAbusePredefinedReasons.RIGHTS, - serverRules: VideoAbusePredefinedReasons.SERVER_RULES, - thumbnails: VideoAbusePredefinedReasons.THUMBNAILS, - captions: VideoAbusePredefinedReasons.CAPTIONS -} diff --git a/shared/models/videos/abuse/video-abuse-state.model.ts b/shared/models/videos/abuse/video-abuse-state.model.ts deleted file mode 100644 index 529f034bd..000000000 --- a/shared/models/videos/abuse/video-abuse-state.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum VideoAbuseState { - PENDING = 1, - REJECTED = 2, - ACCEPTED = 3 -} diff --git a/shared/models/videos/abuse/video-abuse-update.model.ts b/shared/models/videos/abuse/video-abuse-update.model.ts deleted file mode 100644 index 9b32aae48..000000000 --- a/shared/models/videos/abuse/video-abuse-update.model.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VideoAbuseState } from './video-abuse-state.model' - -export interface VideoAbuseUpdate { - moderationComment?: string - state?: VideoAbuseState -} diff --git a/shared/models/videos/abuse/video-abuse-video-is.type.ts b/shared/models/videos/abuse/video-abuse-video-is.type.ts deleted file mode 100644 index e86018993..000000000 --- a/shared/models/videos/abuse/video-abuse-video-is.type.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 38605dcac..000000000 --- a/shared/models/videos/abuse/video-abuse.model.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Account } from '../../actors/index' -import { VideoConstant } from '../video-constant.model' -import { VideoAbuseState } from './video-abuse-state.model' -import { VideoChannel } from '../channel/video-channel.model' -import { VideoAbusePredefinedReasonsString } from './video-abuse-reason.model' - -export interface VideoAbuse { - id: number - reason: string - predefinedReasons?: VideoAbusePredefinedReasonsString[] - reporterAccount: Account - - state: VideoConstant - moderationComment?: string - - video: { - id: number - name: string - uuid: string - nsfw: boolean - deleted: boolean - blacklisted: boolean - thumbnailPath?: string - channel?: VideoChannel - } - - createdAt: Date - updatedAt: Date - - startAt: number - endAt: number - - count?: number - nth?: number - - countReportsForReporter?: number - countReportsForReportee?: number -} diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index e1d96b40a..20b9638ab 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts @@ -1,4 +1,3 @@ -export * from './abuse' export * from './blacklist' export * from './caption' export * from './channel' -- cgit v1.2.3