X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Ffeeds.ts;h=865f5c2a129006c7ca7422bbb499ac2af0a8226f;hb=c756bae079e02873f6433582ca14a092fec0db27;hp=921067e655623924b63b80439b9bceda281c879c;hpb=903353d67a8d0fdda8465ed6c57b77a9a5afbe92;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index 921067e65..865f5c2a1 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts @@ -167,7 +167,7 @@ async function generateVideoFeed (req: express.Request, res: express.Response) { videoChannelId: videoChannel ? videoChannel.id : null } - const resultList = await VideoModel.listForApi({ + const { data } = await VideoModel.listForApi({ start, count: FEEDS.COUNT, sort: req.query.sort, @@ -175,10 +175,11 @@ async function generateVideoFeed (req: express.Request, res: express.Response) { nsfw, filter: req.query.filter as VideoFilter, withFiles: true, + countVideos: false, ...options }) - addVideosToFeed(feed, resultList.data) + addVideosToFeed(feed, data) // Now the feed generation is done, let's send it! return sendFeed(feed, req, res) @@ -198,20 +199,22 @@ async function generateVideoFeedForSubscriptions (req: express.Request, res: exp queryString: new URL(WEBSERVER.URL + req.url).search }) - const resultList = await VideoModel.listForApi({ + const { data } = await VideoModel.listForApi({ start, count: FEEDS.COUNT, sort: req.query.sort, includeLocalVideos: false, nsfw, filter: req.query.filter as VideoFilter, + withFiles: true, + countVideos: false, followerActorId: res.locals.user.Account.Actor.id, user: res.locals.user }) - addVideosToFeed(feed, resultList.data) + addVideosToFeed(feed, data) // Now the feed generation is done, let's send it! return sendFeed(feed, req, res) @@ -290,7 +293,7 @@ function addVideosToFeed (feed, videos: VideoModel[]) { feed.addItem({ title: video.name, id: video.url, - link: WEBSERVER.URL + '/videos/watch/' + video.uuid, + link: WEBSERVER.URL + '/w/' + video.uuid, description: video.getTruncatedDescription(), content: video.description, author: [