diff --git a/internal/handlers/opds.go b/internal/handlers/opds.go index 7b5d286..9b5d34b 100644 --- a/internal/handlers/opds.go +++ b/internal/handlers/opds.go @@ -605,6 +605,12 @@ func (h *OPDSHandler) DownloadBook(c *echo.Context) error { if mediaItem.MimeType.Valid { mimeType = mediaItem.MimeType.String } + // Always expose the primary content hash so clients (e.g. the koreader + // plugin) learn the canonical SHA-256 from the download response itself, + // not just from the feed metadata. + if mediaItem.FileSha256.Valid { + fileSha256 = mediaItem.FileSha256.String + } } // Check if file exists