mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add back missing pubdate check
This commit is contained in:
parent
7848413645
commit
d592dc44c6
1 changed files with 9 additions and 0 deletions
|
|
@ -242,6 +242,15 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
const feed = await parser.parseString(fetchResult.content)
|
||||
console.log('Fetched feed', feed.title, new Date())
|
||||
|
||||
const feedPubDate = (feed['dc:date'] ||
|
||||
feed.pubDate ||
|
||||
feed.lastBuildDate) as string | undefined
|
||||
console.log('Feed pub date', feedPubDate)
|
||||
if (feedPubDate && new Date(feedPubDate) < new Date(lastFetchedAt)) {
|
||||
console.log('Skipping old feed', feedPubDate)
|
||||
return res.send('ok')
|
||||
}
|
||||
|
||||
// save each item in the feed
|
||||
for (const item of feed.items) {
|
||||
// use published or updated if isoDate is not available for atom feeds
|
||||
|
|
|
|||
Loading…
Reference in a new issue