mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
use published or updated if isoDate is not available for atom feeds
This commit is contained in:
parent
c6c26ed3ab
commit
85575917ff
1 changed files with 4 additions and 1 deletions
|
|
@ -119,7 +119,7 @@ Sentry.GCPFunction.init({
|
|||
const signToken = promisify(jwt.sign)
|
||||
const parser = new Parser({
|
||||
customFields: {
|
||||
item: [['link', 'links', { keepArray: true }]],
|
||||
item: [['link', 'links', { keepArray: true }], 'published', 'updated'],
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -192,6 +192,9 @@ export const rssHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
|
||||
// save each item in the feed
|
||||
for (const item of feed.items) {
|
||||
// use published or updated if isoDate is not available for atom feeds
|
||||
item.isoDate =
|
||||
item.isoDate || (item.published as string) || (item.updated as string)
|
||||
console.log('Processing feed item', item.links, item.isoDate)
|
||||
|
||||
if (!item.links || item.links.length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue