From a0dcc860b40341fb203dcbb5abb13e58e609ffbd Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Tue, 26 May 2026 14:09:36 +0200 Subject: [PATCH] feat(audiobooks): mount ABS bookmark routes at /abs/api and /api Registers POST/PATCH/DELETE /me/item/{itemId}/bookmark inside the existing bearerAuth group so real ABS clients hitting either prefix resolve to the same handlers. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/audiobooks/abs/handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/audiobooks/abs/handler.go b/internal/audiobooks/abs/handler.go index 6b91e2b6..b49e5f1e 100644 --- a/internal/audiobooks/abs/handler.go +++ b/internal/audiobooks/abs/handler.go @@ -313,6 +313,10 @@ func (h *Handler) mountRoutes(r chi.Router) { r.Patch(prefix+"/session/{sid}", h.handleSessionSync) // POST /session/{sid}/close — finalise the play session r.Post(prefix+"/session/{sid}/close", h.handleSessionClose) + // Bookmarks — POST/PATCH both upsert; DELETE is idempotent. + r.Post(prefix+"/me/item/{itemId}/bookmark", h.handleUpsertBookmark("bookmark_created")) + r.Patch(prefix+"/me/item/{itemId}/bookmark", h.handleUpsertBookmark("bookmark_updated")) + r.Delete(prefix+"/me/item/{itemId}/bookmark/{time}", h.handleDeleteBookmark) } })