diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-24 17:19:00 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 17:29:19 +0200 |
commit | 8519cc92341545468104f0704fff64a05c84bec0 (patch) | |
tree | de67ec4981ae2ce74d7a12c1adad5883f90fc7f5 /server/models | |
parent | 9ce3d3027ed7253fbd4fe46787eda58c51549444 (diff) | |
download | PeerTube-8519cc92341545468104f0704fff64a05c84bec0.tar.gz PeerTube-8519cc92341545468104f0704fff64a05c84bec0.tar.zst PeerTube-8519cc92341545468104f0704fff64a05c84bec0.zip |
Fix overview endpoint
Diffstat (limited to 'server/models')
-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 = { |