From 8519cc92341545468104f0704fff64a05c84bec0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Apr 2019 17:19:00 +0200 Subject: Fix overview endpoint --- server/models/video/video.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/models/video') 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 = { followerActorId: number includeLocalVideos: boolean + withoutId?: boolean + filter?: VideoFilter categoryOneOf?: number[] nsfw?: boolean @@ -268,9 +270,11 @@ type AvailableForListIDsOptions = { return query }, [ ScopeNames.AVAILABLE_FOR_LIST_IDS ]: (options: AvailableForListIDsOptions) => { + const attributes = options.withoutId === true ? [] : [ 'id' ] + const query: FindOptions = { raw: true, - attributes: [ 'id' ], + attributes, where: { id: { [ Op.and ]: [ @@ -1523,7 +1527,8 @@ export class VideoModel extends Model { const scopeOptions: AvailableForListIDsOptions = { serverAccountId: serverActor.Account.id, followerActorId, - includeLocalVideos: true + includeLocalVideos: true, + withoutId: true // Don't break aggregation } const query: FindOptions = { -- cgit v1.2.3