fix(route)(douban/wish): username in feed title (#9408)

fix(route)(douban/wish): username in feed title
This commit is contained in:
Rongrong
2022-03-28 17:47:10 -11:00
committed by GitHub
parent 8e5971ec2d
commit 1fc9c4aa0d
+4 -1
View File
@@ -13,6 +13,8 @@ module.exports = async (ctx) => {
const torrentMinRating = routeParams.torrentMinRating ? parseFloat(routeParams.torrentMinRating) : 0.5;
const torrentSkipNoMatch = routeParams.torrentSkipNoMatch === 'true';
let userName;
const pageSize = 15;
const pagesCount = routeParams.pagesCount ? parseInt(routeParams.pagesCount) : 1;
const tasks = [];
@@ -31,6 +33,7 @@ module.exports = async (ctx) => {
const data = response.data;
const $ = cheerio.load(data);
const list = $('div.article > div.grid-view > div.item');
userName = userName || $('div.side-info-txt > h3').text();
if (list) {
return Promise.all(
@@ -73,7 +76,7 @@ module.exports = async (ctx) => {
items = items.filter((item) => item.enclosure_url && item.enclosure_url.length > 0);
}
ctx.state.data = {
title: `豆瓣想看 - ${userid}`,
title: `豆瓣想看 - ${userName || userid}`,
link: `https://movie.douban.com/people/${userid}/wish`,
item: items,
};