diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-14 09:08:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-14 09:27:18 +0200 |
commit | 191764f30b0a812bf3a9dbdc7daf1d5afe25e12a (patch) | |
tree | a5592f8d89949cde832f025e393a3821ad2aca37 /server/models/video/video-blacklist.ts | |
parent | 26b7305a232e547709f433a6edf700bf495935d8 (diff) | |
download | PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.tar.gz PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.tar.zst PeerTube-191764f30b0a812bf3a9dbdc7daf1d5afe25e12a.zip |
Improve blacklist management
Diffstat (limited to 'server/models/video/video-blacklist.ts')
-rw-r--r-- | server/models/video/video-blacklist.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 1b8a338cb..eabc37ef0 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts | |||
@@ -16,7 +16,7 @@ import { getSortOnModel, throwIfNotValid } from '../utils' | |||
16 | import { VideoModel } from './video' | 16 | import { VideoModel } from './video' |
17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' | 17 | import { isVideoBlacklistReasonValid } from '../../helpers/custom-validators/video-blacklist' |
18 | import { Emailer } from '../../lib/emailer' | 18 | import { Emailer } from '../../lib/emailer' |
19 | import { BlacklistedVideo } from '../../../shared/models/videos' | 19 | import { VideoBlacklist } from '../../../shared/models/videos' |
20 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 20 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
21 | 21 | ||
22 | @Table({ | 22 | @Table({ |
@@ -68,7 +68,12 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
68 | offset: start, | 68 | offset: start, |
69 | limit: count, | 69 | limit: count, |
70 | order: getSortOnModel(sort.sortModel, sort.sortValue), | 70 | order: getSortOnModel(sort.sortModel, sort.sortValue), |
71 | include: [ { model: VideoModel } ] | 71 | include: [ |
72 | { | ||
73 | model: VideoModel, | ||
74 | required: true | ||
75 | } | ||
76 | ] | ||
72 | } | 77 | } |
73 | 78 | ||
74 | return VideoBlacklistModel.findAndCountAll(query) | 79 | return VideoBlacklistModel.findAndCountAll(query) |
@@ -90,7 +95,7 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> { | |||
90 | return VideoBlacklistModel.findOne(query) | 95 | return VideoBlacklistModel.findOne(query) |
91 | } | 96 | } |
92 | 97 | ||
93 | toFormattedJSON (): BlacklistedVideo { | 98 | toFormattedJSON (): VideoBlacklist { |
94 | const video = this.Video | 99 | const video = this.Video |
95 | 100 | ||
96 | return { | 101 | return { |