diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-27 14:37:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-10-29 11:48:21 +0200 |
commit | 2760b454a761f6af3138b2fb5f34340772ab0d1e (patch) | |
tree | 2b3a2d81478f8b432eb54cce4caa5a760c494627 /server/controllers/api/users | |
parent | e4611b54910d8e7f2b4f8a97ee2d9cc8e1054127 (diff) | |
download | PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.gz PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.tar.zst PeerTube-2760b454a761f6af3138b2fb5f34340772ab0d1e.zip |
Deprecate filter video query
Introduce include and isLocal instead
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r-- | server/controllers/api/users/my-subscriptions.ts | 9 |
1 files changed, 6 insertions, 3 deletions
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' | |||
2 | import express from 'express' | 2 | import express from 'express' |
3 | import { pickCommonVideoQuery } from '@server/helpers/query' | 3 | import { pickCommonVideoQuery } from '@server/helpers/query' |
4 | import { sendUndoFollow } from '@server/lib/activitypub/send' | 4 | import { sendUndoFollow } from '@server/lib/activitypub/send' |
5 | import { guessAdditionalAttributesFromQuery } from '@server/models/video/formatter/video-format-utils' | ||
5 | import { VideoChannelModel } from '@server/models/video/video-channel' | 6 | import { VideoChannelModel } from '@server/models/video/video-channel' |
6 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' | 7 | import { HttpStatusCode } from '../../../../shared/models/http/http-error-codes' |
7 | import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' | 8 | import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' |
@@ -175,13 +176,15 @@ async function getUserSubscriptionVideos (req: express.Request, res: express.Res | |||
175 | const resultList = await VideoModel.listForApi({ | 176 | const resultList = await VideoModel.listForApi({ |
176 | ...query, | 177 | ...query, |
177 | 178 | ||
178 | includeLocalVideos: false, | 179 | displayOnlyForFollower: { |
180 | actorId: user.Account.Actor.id, | ||
181 | orLocalVideos: false | ||
182 | }, | ||
179 | nsfw: buildNSFWFilter(res, query.nsfw), | 183 | nsfw: buildNSFWFilter(res, query.nsfw), |
180 | withFiles: false, | 184 | withFiles: false, |
181 | followerActorId: user.Account.Actor.id, | ||
182 | user, | 185 | user, |
183 | countVideos | 186 | countVideos |
184 | }) | 187 | }) |
185 | 188 | ||
186 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 189 | return res.json(getFormattedObjects(resultList.data, resultList.total, guessAdditionalAttributesFromQuery(query))) |
187 | } | 190 | } |