Skip to content

Commit

Permalink
fix(route): weibo (#15398)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarasuShin authored Apr 28, 2024
1 parent 1c69812 commit b566ebb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/routes/weibo/keyword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ async function handler(ctx) {
title: `又有人在微博提到${keyword}了`,
link: `http://s.weibo.com/weibo/${encodeURIComponent(keyword)}&b=1&nodup=1`,
description: `又有人在微博提到${keyword}了`,
item: data.map((item) => {
item.mblog.created_at = timezone(item.mblog.created_at, +8);
if (item.mblog.retweeted_status && item.mblog.retweeted_status.created_at) {
item.mblog.retweeted_status.created_at = timezone(item.mblog.retweeted_status.created_at, +8);
}
return weiboUtils.formatExtended(ctx, item.mblog, undefined, {
showAuthorInTitle: fallback(undefined, queryToBoolean(routeParams.showAuthorInTitle), true),
showAuthorInDesc: fallback(undefined, queryToBoolean(routeParams.showAuthorInDesc), true),
});
}),
item: data
.filter((i) => i.mblog)
.map((item) => {
item.mblog.created_at = timezone(item.mblog.created_at, +8);
if (item.mblog.retweeted_status && item.mblog.retweeted_status.created_at) {
item.mblog.retweeted_status.created_at = timezone(item.mblog.retweeted_status.created_at, +8);
}
return weiboUtils.formatExtended(ctx, item.mblog, undefined, {
showAuthorInTitle: fallback(undefined, queryToBoolean(routeParams.showAuthorInTitle), true),
showAuthorInDesc: fallback(undefined, queryToBoolean(routeParams.showAuthorInDesc), true),
});
}),
});
}

0 comments on commit b566ebb

Please sign in to comment.