Skip to content

Commit 2204a28

Browse files
committed
opds: add id and updated fields
1 parent 450a7f0 commit 2204a28

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

opds.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,15 @@ export const getPublication = entry => {
210210
const linksByRel = groupByArray(links, link => link.rel)
211211
return {
212212
metadata: {
213+
id: children.find(filter('id'))?.textContent ?? undefined,
214+
updated: children.find(filter('updated'))?.textContent ?? undefined,
213215
title: children.find(filter('title'))?.textContent ?? undefined,
214216
author: children.filter(filter('author')).map(getPerson),
215217
contributor: children.filter(filter('contributor')).map(getPerson),
216218
publisher: children.find(filterDC('publisher'))?.textContent ?? undefined,
217-
published: (children.find(filterDCTERMS('issued')) ?? children.find(filterDC('date')))?.textContent ?? undefined,
219+
published: (children.find(filter('published'))
220+
?? children.find(filterDCTERMS('issued'))
221+
?? children.find(filterDC('date')))?.textContent ?? undefined,
218222
language: children.find(filterDC('language'))?.textContent ?? undefined,
219223
identifier: children.find(filterDC('identifier'))?.textContent ?? undefined,
220224
subject: children.filter(filter('category')).map(category => ({
@@ -319,6 +323,8 @@ export const getFeed = doc => {
319323

320324
return {
321325
metadata: {
326+
id: children.find(filter('id'))?.textContent ?? undefined,
327+
updated: children.find(filter('updated'))?.textContent ?? undefined,
322328
title: children.find(filter('title'))?.textContent ?? undefined,
323329
subtitle: children.find(filter('subtitle'))?.textContent ?? undefined,
324330
numberOfItems: totalResults != null ? Number(totalResults) : undefined,

0 commit comments

Comments
 (0)