X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-blacklist.ts;h=67f7cd4871c0aeef041996ff11f557002e26ebfd;hb=156c50af3085468a47b8ae73fe8cfcae46b42398;hp=1b8a338cb5e334e23dd5b1611ccec08bcfa88e5e;hpb=26b7305a232e547709f433a6edf700bf495935d8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 1b8a338cb..67f7cd487 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -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 { 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 { return VideoBlacklistModel.findOne(query) } - toFormattedJSON (): BlacklistedVideo { + toFormattedJSON (): VideoBlacklist { const video = this.Video return {