From effb9d7c788f59ca96941b4f33ee56c09be928c1 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Mon, 17 Feb 2025 08:07:57 +0100 Subject: [PATCH] Improve feed parser --- tasks/fetch_feed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/fetch_feed.js b/tasks/fetch_feed.js index 47c78fdc531..4a8068f1e98 100644 --- a/tasks/fetch_feed.js +++ b/tasks/fetch_feed.js @@ -57,7 +57,9 @@ const parseEpisode = e => { if (categoryName === 'NostrTalk') categoryName = 'NostrTalk' if (categoryName === 'FilterFrei') categoryName = 'FilterFrei' const lines = descriptionPlain.trim().split('\n') - const firstLine = lines.find(l => l.match(regexBlockzeit)) || lines[0] || '' + const firstLine = lines.length === 1 + ? stripHTML(description.match(/^.*?<\/p>/)[0] || '') + : lines.find(l => l.match(regexBlockzeit)) || lines[0] || '' const blockMatch = firstLine.match(regexBlockzeit) const block = blockMatch ? parseInt(blockMatch[1].replace('.', '')) : null const category = slugify(categoryName)