title prefix support
All checks were successful
/ build (push) Successful in 1m45s

This commit is contained in:
mr-boneman 2024-08-20 17:50:20 +02:00
parent 52cb376335
commit ab85f65044
2 changed files with 19 additions and 1 deletions

View file

@ -9,6 +9,7 @@ type RssFeed* = object
url*: string
kind*: FeedType
timeFormat*: string
titlePrefix*: string
proc parseAtomTime(s: string): DateTime =
parse(s, atomTimeFormat)
@ -57,6 +58,15 @@ proc mixRssFeeds*(feeds: seq[RssFeed], name, id, link, authorName, description:s
item
)
if feed.titlePrefix.len > 0:
entries[^1].items = entries[^1].items.mapIt(
block:
var item = it
if item.title.isSome():
item.title = some(feed.titlePrefix&item.title.get())
item
)
for feed in entries:
result.items.add feed.items