fix: web dashboard Reader fetches article content on select
Slim list mode means list responses no longer include content.
Now selectArticle() fetches the full entry via GET /entries/{id}
before displaying, then optionally crawls for full content if short.
Also uses API thumbnail field instead of extracting from empty content.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,7 +62,7 @@
|
|||||||
return {
|
return {
|
||||||
id: e.id, title: e.title, feed: e.feed?.title || '', url: e.url,
|
id: e.id, title: e.title, feed: e.feed?.title || '', url: e.url,
|
||||||
timeAgo: timeAgo(e.published_at), readingTime: `${e.reading_time || 1} min`,
|
timeAgo: timeAgo(e.published_at), readingTime: `${e.reading_time || 1} min`,
|
||||||
content: e.content || '', thumbnail: extractThumb(e.content),
|
content: e.content || '', thumbnail: e.thumbnail || extractThumb(e.content),
|
||||||
starred: e.starred || false, read: e.status === 'read',
|
starred: e.starred || false, read: e.status === 'read',
|
||||||
author: e.author || ''
|
author: e.author || ''
|
||||||
};
|
};
|
||||||
@@ -305,10 +305,25 @@
|
|||||||
markEntryRead(article.id);
|
markEntryRead(article.id);
|
||||||
decrementUnread();
|
decrementUnread();
|
||||||
}
|
}
|
||||||
// Auto-fetch full article content if we only have RSS summary
|
// Fetch full entry content (slim list doesn't include it)
|
||||||
if (article.content && article.content.length < 1500) {
|
loadArticleContent(article);
|
||||||
fetchFullContent(article);
|
}
|
||||||
}
|
|
||||||
|
async function loadArticleContent(article: Article) {
|
||||||
|
try {
|
||||||
|
const data = await api(`/entries/${article.id}`);
|
||||||
|
const content = data.full_content || data.content || '';
|
||||||
|
article.content = content;
|
||||||
|
if (data.thumbnail) article.thumbnail = data.thumbnail;
|
||||||
|
if (selectedArticle?.id === article.id) {
|
||||||
|
selectedArticle = { ...article };
|
||||||
|
}
|
||||||
|
articles = [...articles];
|
||||||
|
// If content is short, try fetching full article via crawler
|
||||||
|
if (content.length < 1500) {
|
||||||
|
fetchFullContent(article);
|
||||||
|
}
|
||||||
|
} catch { /* silent */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchFullContent(article: Article) {
|
async function fetchFullContent(article: Article) {
|
||||||
|
|||||||
Reference in New Issue
Block a user