diff --git a/lib/routes/bbc/index.ts b/lib/routes/bbc/index.ts index 88ce4dd78..320b85aa3 100644 --- a/lib/routes/bbc/index.ts +++ b/lib/routes/bbc/index.ts @@ -65,18 +65,26 @@ async function handler(ctx) { const $ = load(response); - const description = new URL(item.link).pathname.startsWith('/news/av') ? item.content : utils.ProcessFeed($); + const path = new URL(item.link).pathname; - let section = 'sport'; - const urlSplit = item.link.split('/'); - const sectionSplit = urlSplit.at(-1).split('-'); - if (sectionSplit.length > 1) { - section = sectionSplit[0]; + let description; + + switch (true) { + case path.startsWith('/sport'): + description = item.content; + break; + case path.startsWith('/sounds/play'): + description = item.content; + break; + case path.startsWith('/news/live'): + description = item.content; + break; + default: + description = utils.ProcessFeed($); } - section = section[0].toUpperCase() + section.slice(1); return { - title: `[${section}] ${item.title}`, + title: item.title, description, pubDate: item.pubDate, link: item.link,