From bdad40e21176cc7a56bc12e6e35f659fc32b64c7 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 17 Oct 2026 14:05:35 -0400 Subject: [PATCH] =?UTF-8?q?refactor(cards):=20bookshelf=20SSR=20through=20?= =?UTF-8?q?the=20builder=20=E2=80=94=20badges=20return=20to=20the=20booksh?= =?UTF-8?q?elf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ExecuteSearch-driven bookshelf page fed SearchMediaItemsUnifiedRow — which HAS FormatGroup and LibraryTypeName — into a bare 4-field literal that dropped both, so bookshelf cards lost the media-type badge the shelf once had. BookCardsFromUnified emits badge/format on this surface (card-marking rides on; the SQL column strategy means zero extra queries). audiobook shelves regain the corner glyph. --- internal/router/frontend.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/internal/router/frontend.go b/internal/router/frontend.go index 7492e8fb..d8d8fdd2 100644 --- a/internal/router/frontend.go +++ b/internal/router/frontend.go @@ -373,17 +373,7 @@ func registerFrontendRoutes(cfg *Config) { if err != nil { log.Printf("ExecuteSearch failed: %v", err) } else { - bookInfoList = make([]handlers.BookInfo, len(results)) - for i, book := range results { - bookUUID, _ := uuid.FromBytes(book.ID.Bytes[0:16]) - bookLibUUID, _ := uuid.FromBytes(book.LibraryID.Bytes[0:16]) - bookInfoList[i] = handlers.BookInfo{ - MediaItemID: bookUUID.String(), - Title: book.Title, - Author: textToString(book.Author), - CoverImagePath: utils.ResolveMediaURL(pgtype.UUID{Bytes: bookLibUUID, Valid: true}, book.CoverImagePath), - } - } + bookInfoList = handlers.BookCardsFromUnified(results) } }