Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx committed Nov 13, 2024
1 parent 362edc0 commit b0fadae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/routes/caixin/latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ async function handler(ctx) {
// desc
const desc = await parseArticle(item);

item.description = ctx.req.query('fulltext') === 'true' ? ((await getFulltext(item.link)) ?? desc.description) : desc.description;
if (ctx.req.query('fulltext') === 'true') {
const authorizedFullText = await getFulltext(item.link);
item.description = authorizedFullText === '' ? desc.description : authorizedFullText;
} else {
item.description = desc.description;
}
// prevent cache coliision with /caixin/article and /caixin/:column/:category
// since those have podcasts
item.guid = `caixin:latest:${item.link}`;
Expand Down

0 comments on commit b0fadae

Please sign in to comment.