refactor(cards): bookshelf SSR through the builder — badges return to the bookshelf
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.
This commit is contained in:
1 parent
8c56c9da55
commit
bdad40e211
1 file changed
+1
-11
@@ -373,17 +373,7 @@ func registerFrontendRoutes(cfg *Config) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("ExecuteSearch failed: %v", err)
|
log.Printf("ExecuteSearch failed: %v", err)
|
||||||
} else {
|
} else {
|
||||||
bookInfoList = make([]handlers.BookInfo, len(results))
|
bookInfoList = handlers.BookCardsFromUnified(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),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user