diff options
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 5fb529e8d..4e6f602aa 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -207,6 +207,8 @@ type AvailableForListIDsOptions = { | |||
207 | followerActorId: number | 207 | followerActorId: number |
208 | includeLocalVideos: boolean | 208 | includeLocalVideos: boolean |
209 | 209 | ||
210 | withoutId?: boolean | ||
211 | |||
210 | filter?: VideoFilter | 212 | filter?: VideoFilter |
211 | categoryOneOf?: number[] | 213 | categoryOneOf?: number[] |
212 | nsfw?: boolean | 214 | nsfw?: boolean |
@@ -268,9 +270,11 @@ type AvailableForListIDsOptions = { | |||
268 | return query | 270 | return query |
269 | }, | 271 | }, |
270 | [ ScopeNames.AVAILABLE_FOR_LIST_IDS ]: (options: AvailableForListIDsOptions) => { | 272 | [ ScopeNames.AVAILABLE_FOR_LIST_IDS ]: (options: AvailableForListIDsOptions) => { |
273 | const attributes = options.withoutId === true ? [] : [ 'id' ] | ||
274 | |||
271 | const query: FindOptions = { | 275 | const query: FindOptions = { |
272 | raw: true, | 276 | raw: true, |
273 | attributes: [ 'id' ], | 277 | attributes, |
274 | where: { | 278 | where: { |
275 | id: { | 279 | id: { |
276 | [ Op.and ]: [ | 280 | [ Op.and ]: [ |
@@ -1523,7 +1527,8 @@ export class VideoModel extends Model<VideoModel> { | |||
1523 | const scopeOptions: AvailableForListIDsOptions = { | 1527 | const scopeOptions: AvailableForListIDsOptions = { |
1524 | serverAccountId: serverActor.Account.id, | 1528 | serverAccountId: serverActor.Account.id, |
1525 | followerActorId, | 1529 | followerActorId, |
1526 | includeLocalVideos: true | 1530 | includeLocalVideos: true, |
1531 | withoutId: true // Don't break aggregation | ||
1527 | } | 1532 | } |
1528 | 1533 | ||
1529 | const query: FindOptions = { | 1534 | const query: FindOptions = { |