Skip to content

Commit

Permalink
EKIRJASTO-131 Add selected tag to OPDS feed
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-kaisa committed Dec 16, 2024
1 parent b34decd commit 8a3bb20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/feed/serializer/opds.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"patron": f"{{{OPDSFeed.SIMPLIFIED_NS}}}patron",
"series": f"{{{OPDSFeed.SCHEMA_NS}}}series",
"hashed_passphrase": f"{{{OPDSFeed.LCP_NS}}}hashed_passphrase",
"selected": f"{{{OPDSFeed.SIMPLIFIED_NS}}}selected",
}

ATTRIBUTE_MAPPING = {
Expand Down Expand Up @@ -264,6 +265,9 @@ def serialize_work_entry(self, feed_entry: WorkEntryData) -> etree._Element:
for link in feed_entry.other_links:
entry.append(OPDSFeed.link(**link.asdict()))

if feed_entry.selected:
entry.append(OPDSFeed.E("selected", feed_entry.selected))

return entry

def serialize_opds_message(self, entry: OPDSMessage) -> etree._Element:
Expand Down

0 comments on commit 8a3bb20

Please sign in to comment.