Implement search for books - #43
Open
vanadium23 wants to merge 8 commits into
Open
Conversation
- Add SearchQuery struct with search, sort, order, page, limit fields - Update BookRepo and Shelf interfaces with Search and SearchCount methods - Implement ILIKE-based search across title, author, series, description - Add sorting support for title, author, series, created_at fields - Handle NULL series values correctly in sort (sorted last) - Support multi-word search with AND logic Task: fn-4-add-book-search-and-filter.1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update Shelf interface to use SearchQuery for ListBooks method - Remove separate SearchBooks method (now unified with ListBooks) - Add normalizeSearchQuery helper for validation and defaults - Invalid sort fields default to "title", invalid orders to "asc" - Empty search query returns all books (backward compatibility) - Update web and OPDS controllers to use new interface Task: fn-4-add-book-search-and-filter.2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add search input with placeholder text and submit button - Add sort dropdown (date added, title, author, series) - Add order toggle (ascending/descending) - Sort dropdown auto-submits on change for instant filtering - Add "No books found" message with clear search link - Preserve search/sort params in pagination links (shareable URLs) - Add CSS styles for search controls matching existing design Task: fn-4-add-book-search-and-filter.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create new books.go with GET /api/v1/books endpoint - Add search, sort, order, page, limit query parameters - Return paginated JSON response with books and pagination metadata - Update router.go to register API v1 routes Task: fn-4-add-book-search-and-filter.4
- Parse search query parameter in listNewest handler - Pass search query to ListBooks via SearchQuery struct - Update formNavLinks to preserve search in pagination links - Update feed title and self URL to reflect search state Task: fn-4-add-book-search-and-filter.5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add error.html template for panic recovery - Pin postgres to version 16 in docker-compose for compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author, publisher, isbn, cover_path, and series columns can be NULL in the database but were scanned into non-nullable string fields. Changed to use sql.NullString for these fields in List, GetById, GetByFileHash, and Search methods. Fixes 500 error on /books/ page when database contains NULL values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vanadium23
force-pushed
the
ralph-20260305-134458-0881
branch
from
March 19, 2026 14:40
bc01772 to
f912a34
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.