]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-blacklist.ts
rename blacklist to block/blocklist, merge block and auto-block views
[github/Chocobozzz/PeerTube.git] / server / models / video / video-blacklist.ts
index 680eba471e5f693c55771115e9eb27a70adf4d87..70a6ecb039e1c769dcc800e37201e51410282e52 100644 (file)
@@ -3,7 +3,7 @@ import { getBlacklistSort, SortType, throwIfNotValid, searchAttribute } from '..
 import { VideoModel } from './video'
 import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel'
 import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist'
-import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos'
+import { VideoBlocklist, VideoBlockType } from '../../../shared/models/videos'
 import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
 import { FindOptions } from 'sequelize'
 import { ThumbnailModel } from './thumbnail'
@@ -34,7 +34,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
   @Default(null)
   @Is('VideoBlacklistType', value => throwIfNotValid(value, isVideoBlacklistTypeValid, 'type'))
   @Column
-  type: VideoBlacklistType
+  type: VideoBlockType
 
   @CreatedAt
   createdAt: Date
@@ -59,7 +59,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
     count: number
     sort: SortType
     search?: string
-    type?: VideoBlacklistType
+    type?: VideoBlockType
   }) {
     const { start, count, sort, search, type } = parameters
 
@@ -78,7 +78,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
       {
         model: VideoModel,
         required: true,
-        where: { ...searchAttribute(search, 'name') },
+        where: searchAttribute(search, 'name'),
         include: [
           {
             model: VideoChannelModel.scope({ method: [ VideoChannelScopeNames.SUMMARY, { withAccount: true } as SummaryOptions ] }),
@@ -119,7 +119,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
     return VideoBlacklistModel.findOne(query)
   }
 
-  toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlacklist {
+  toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlocklist {
     return {
       id: this.id,
       createdAt: this.createdAt,