]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-blacklist.ts
Add downloadingEnabled property to video model
[github/Chocobozzz/PeerTube.git] / server / models / video / video-blacklist.ts
index 1b8a338cb5e334e23dd5b1611ccec08bcfa88e5e..67f7cd4871c0aeef041996ff11f557002e26ebfd 100644 (file)
@@ -4,19 +4,19 @@ import {
   AllowNull,
   BelongsTo,
   Column,
-  CreatedAt, DataType,
+  CreatedAt,
+  DataType,
   ForeignKey,
   Is,
   Model,
   Table,
   UpdatedAt
 } from 'sequelize-typescript'
-import { SortType } from '../../helpers/utils'
-import { getSortOnModel, throwIfNotValid } from '../utils'
+import { getSortOnModel, SortType, throwIfNotValid } from '../utils'
 import { VideoModel } from './video'
 import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist'
 import { Emailer } from '../../lib/emailer'
-import { BlacklistedVideo } from '../../../shared/models/videos'
+import { VideoBlacklist } from '../../../shared/models/videos'
 import { CONSTRAINTS_FIELDS } from '../../initializers'
 
 @Table({
@@ -68,7 +68,12 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
       offset: start,
       limit: count,
       order: getSortOnModel(sort.sortModel, sort.sortValue),
-      include: [ { model: VideoModel } ]
+      include: [
+        {
+          model: VideoModel,
+          required: true
+        }
+      ]
     }
 
     return VideoBlacklistModel.findAndCountAll(query)
@@ -90,7 +95,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
     return VideoBlacklistModel.findOne(query)
   }
 
-  toFormattedJSON (): BlacklistedVideo {
+  toFormattedJSON (): VideoBlacklist {
     const video = this.Video
 
     return {