fix(route): bilibili video page ordering, accept common limit params (#9634)

This commit is contained in:
Tony
2022-04-27 04:19:38 +08:00
committed by GitHub
parent a03d51ae2d
commit ff977597f1
+2 -3
View File
@@ -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 ? `<br><br>${utils.iframe(aid, item.page, bvid)}` : ''}`,
pubDate: new Date().toUTCString(),
link: `${link}?p=${item.page}`,
})),
};