API: Include cover image details for book & shelf list responses
Describe the feature you'd like
When making a READ request to the /books/{id} endpoint, the response includes a cover object containing the cover image data for the specified book. However, when making a LIST request to the /books endpoint, the response does not include this cover object.
Including the cover object in the LIST response would allow users to retrieve cover image data for all books in a single request, rather than needing to make separate requests for each book's cover image. This enhancement would reduce the overhead of fetching cover images and improve the efficiency of implementing book search functionalities.
Describe the benefits this would bring to existing BookStack users
- Reduces the overhead associated with making multiple requests to fetch cover images.
- Simplifies API usage by providing a more comprehensive response in a single request.
Can the goal of this request already be achieved via other means?
Yes, it is currently possible to achieve this by making individual requests for each book's cover image. However, this method increases the number of API calls and associated overhead.
Have you searched for an existing open/closed issue?
- [X] I have searched for existing issues and none cover my fundamental request
How long have you been using BookStack?
3 months to 1 year
Additional context
No response
Thanks for the request @ln-ws, I agree with this addition it's something we already do in the UI (list books with cover images). I'm going to update this to also mention shelves since it's the same scenario there. I've assigned this for the next feature release.
Cover images have now been added to book & shelf list responses as part of commit 7e1a8e5ec676a2f9a27acef71da6d6c0b5916384. This will be part of the next feature release.