diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-06 17:19:53 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-06 17:26:51 +0200 |
commit | 6b9c966f6428c9e47bead3410a0401e8ebd744bf (patch) | |
tree | 282218ec56725b0e2e878b0471cd08a54fd91998 /server/models/account | |
parent | 466e3f20a537f1eff4b4fd03297df11ba371d049 (diff) | |
download | PeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.tar.gz PeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.tar.zst PeerTube-6b9c966f6428c9e47bead3410a0401e8ebd744bf.zip |
Automatically remove bad followings
Diffstat (limited to 'server/models/account')
-rw-r--r-- | server/models/account/account-video-rate.ts | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.ts index d5c214ecb..4bd8114cf 100644 --- a/server/models/account/account-video-rate.ts +++ b/server/models/account/account-video-rate.ts | |||
@@ -6,7 +6,7 @@ import { CONSTRAINTS_FIELDS, VIDEO_RATE_TYPES } from '../../initializers/constan | |||
6 | import { VideoModel } from '../video/video' | 6 | import { VideoModel } from '../video/video' |
7 | import { AccountModel } from './account' | 7 | import { AccountModel } from './account' |
8 | import { ActorModel } from '../activitypub/actor' | 8 | import { ActorModel } from '../activitypub/actor' |
9 | import { getSort, throwIfNotValid } from '../utils' | 9 | import { buildLocalAccountIdsIn, getSort, throwIfNotValid } from '../utils' |
10 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' | 10 | import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' |
11 | import { AccountVideoRate } from '../../../shared' | 11 | import { AccountVideoRate } from '../../../shared' |
12 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from '../video/video-channel' | 12 | import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from '../video/video-channel' |
@@ -219,25 +219,11 @@ export class AccountVideoRateModel extends Model<AccountVideoRateModel> { | |||
219 | [Op.lt]: beforeUpdatedAt | 219 | [Op.lt]: beforeUpdatedAt |
220 | }, | 220 | }, |
221 | videoId, | 221 | videoId, |
222 | type | 222 | type, |
223 | }, | 223 | accountId: { |
224 | include: [ | 224 | [Op.notIn]: buildLocalAccountIdsIn() |
225 | { | ||
226 | model: AccountModel.unscoped(), | ||
227 | required: true, | ||
228 | include: [ | ||
229 | { | ||
230 | model: ActorModel.unscoped(), | ||
231 | required: true, | ||
232 | where: { | ||
233 | serverId: { | ||
234 | [Op.ne]: null | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | ] | ||
239 | } | 225 | } |
240 | ], | 226 | }, |
241 | transaction: t | 227 | transaction: t |
242 | } | 228 | } |
243 | 229 | ||