From ff977597f1bcba523d27f9fcfe6aad627f666f1b Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 26 Apr 2022 21:19:38 +0100 Subject: [PATCH] fix(route): bilibili video page ordering, accept common limit params (#9634) --- lib/v2/bilibili/page.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/v2/bilibili/page.js b/lib/v2/bilibili/page.js index 1f376e3f5..1b503e098 100644 --- a/lib/v2/bilibili/page.js +++ b/lib/v2/bilibili/page.js @@ -25,12 +25,11 @@ module.exports = async (ctx) => { link, description: `视频 ${name} 的视频选集列表`, item: data - .sort((a, b) => b.cid - a.cid) - .slice(0, 10) + .sort((a, b) => b.page - a.page) + .slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 10) .map((item) => ({ title: item.part, description: `${item.part} - ${name}${!disableEmbed ? `

${utils.iframe(aid, item.page, bvid)}` : ''}`, - pubDate: new Date().toUTCString(), link: `${link}?p=${item.page}`, })), };