From 2760b454a761f6af3138b2fb5f34340772ab0d1e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Oct 2021 14:37:04 +0200 Subject: Deprecate filter video query Introduce include and isLocal instead --- server/controllers/api/users/my-subscriptions.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/controllers/api/users') diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts index b2b441673..d96378180 100644 --- a/server/controllers/api/users/my-subscriptions.ts +++ b/server/controllers/api/users/my-subscriptions.ts @@ -2,6 +2,7 @@ import 'multer' import express from 'express' import { pickCommonVideoQuery } from '@server/helpers/query' import { sendUndoFollow } from '@server/lib/activitypub/send' +import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' import { VideoChannelModel } from '@server/models/video/video-channel' import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' @@ -175,13 +176,15 @@ async function getUserSubscriptionVideos (req: express.Request, res: express.Res const resultList = await VideoModel.listForApi({ ...query, - includeLocalVideos: false, + displayOnlyForFollower: { + actorId: user.Account.Actor.id, + orLocalVideos: false + }, nsfw: buildNSFWFilter(res, query.nsfw), withFiles: false, - followerActorId: user.Account.Actor.id, user, countVideos }) - return res.json(getFormattedObjects(resultList.data, resultList.total)) + return res.json(getFormattedObjects(resultList.data, resultList.total, guessAdditionalAttributesFromQuery(query))) } -- cgit v1.2.3