Skip to content

Overdrive: Returning borrowed books (partially) fails #3398

@altair

Description

@altair

Describe the bug/problem

Overdrive/borrowed books functionality appears to fail when attempting to return a borrowed book using the Calibre-Web Kobo integration. On the first attempt to return a book, you are presented with the "Connecting to Overdrive..." screen indefinitely.

Notably, the book is returned correctly behind the scenes, so the Kobo API proxying is at least partially working, or alternatively the bulk of the Overdrive integration does not use the regular API endpoint. It seems that one of the calls that should be proxied fails and it breaks this specific aspect of the Overdrive/sync behaviour.

Most other functionality remains working, but subsequent attempts to use the "Return" option fail immediately (presumably because it has already been returned in the background) and the book will not ever remove itself as per the normal behavior of being replaced by a Kobo preview. You can remove the book manually and as mentioned the book has been returned behind the scenes correctly, it is just irritating to have to do so.

I am using a Kobo Clara BW.

To Reproduce

Steps to reproduce the behavior:

  1. Borrow a book via the Overdrive integration.
  2. Return the book using the "Return" option from the actions menu ('...') of the book.
  3. See "Connecting to Overdrive..."
  4. Overdrive sync fails to fully complete and trigger a subsequent Kobo sync

Logfile

From access.log:
192.168.x.x - - [2025-05-23 11:30:50] "POST /kobo/<kobo_key>/v1/library/<book_id>/preview HTTP/1.0" 404 1742 0.009836

Expected behavior

The failing proxy call should succeed, allowing followup sync process to continue correctly.

I believe that there simply needs to be a route configured for the library/<id>/preview call for this to behave correctly so I will be submitting a PR shortly after testing the idea.

Environment (please complete the following information):

  • OS: Ubuntu
  • Python version: 3.12.3
  • Calibre-Web version: 0.6.24
  • Docker container: LinuxServer
  • Browser: Mozilla/5.0 (Linux; U; Android 2.0; en-us;) AppleWebKit/538.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/538.1 (Kobo Touch 0391/4.41.23145

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions