Skip to content

Commit

Permalink
EKIRJASTO-131 Add selected book to work feed
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-kaisa committed Dec 16, 2024
1 parent 8a3bb20 commit be64d30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/controller/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def contributor(
def permalink(self, identifier_type, identifier):
"""Serve an entry for a single book.
This does not include any loan or hold-specific information for
the authenticated patron.
This includes any loan or hold-specific information as well as selected book information for an authenticated patron.
This is different from the /works lookup protocol, in that it
returns a single entry while the /works lookup protocol returns a
Expand All @@ -124,8 +123,10 @@ def permalink(self, identifier_type, identifier):
item = loan or hold
pool = pool or pools[0]

selected_book = patron.load_selected_book(work)

return OPDSAcquisitionFeed.single_entry_loans_feed(
self.circulation, item or pool
self.circulation, item or pool, selected_book=selected_book
)
else:
annotator = self.manager.annotator(lane=None)
Expand Down

0 comments on commit be64d30

Please sign in to comment.