Repository navigation
Conversation
- Display cached matches automatically when selecting a book - Prevent stale responses from overwriting the current selection - Cache partial results even when another catalog fails - Preserve provider warnings alongside cached matches - Infer reviewable series and volume hints from structured filenames - Retain catalog series labels without volume numbers - Flag volume conflicts between catalog and filename clues - Document automatic cache loading and partial-result caching
- Align CBZ metadata handling with ComicInfo v2.0 - Recognize EPUB 2 contributor roles and verify EPUB package metadata - Add regression tests across metadata, app, catalog, persistence, and runtime - Update CI and project documentation
There was a problem hiding this comment.
🟡 Changes recommended
CBZ ratings cannot be cleared, filename cleanup can produce malformed inferred titles, and the cached-search regression test does not exercise a cache hit.
4 open findings
What changed in this PR
Improves metadata matching and format handling while expanding regression coverage and documentation.
Changes:
- Loads cached matches and improves series/title inference.
- Aligns EPUB, CBZ, and PDF metadata behavior.
- Adds broad Go test coverage and runs tests in CI.
| File | Description |
|---|---|
| README.md | Updates usage and settings guidance. |
| MAINTAINER.md | Documents build reproducibility limits. |
| BUILD.md | Adds Go tests to verification steps. |
| Dockerfile | Runs tests during build checks. |
| .github/workflows/ci.yml | Reflects test execution in CI. |
| docs/architecture.md | Documents partial-result caching. |
| docs/ux.md | Updates draft and background-work behavior. |
| cmd/shelfmark/options_test.go | Tests command-line parsing. |
| internal/app/proposal.go | Encodes list fields safely for editing. |
| internal/app/search.go | Adds cache-only match retrieval. |
| internal/app/server.go | Registers the cached-search endpoint. |
| internal/app/server_test.go | Tests API workflows and caching. |
| internal/catalog/catalog_test.go | Adds catalog and reconciliation tests. |
| internal/catalog/proposal.go | Improves series and volume inference. |
| internal/desktop/desktop_test.go | Tests secure runtime extraction. |
| internal/library/book_label.go | Infers separated filename volumes. |
| internal/library/library_test.go | Tests matching and field parsing. |
| internal/library/presentation.go | Adds CSV list-field round trips. |
| internal/metadata/comic.go | Aligns CBZ handling with ComicInfo. |
| internal/metadata/comic_test.go | Tests CBZ limits and round trips. |
| internal/metadata/epub_contributors.go | Handles namespaced EPUB 2 roles. |
| internal/metadata/fields.go | Adds format-specific validation. |
| internal/metadata/fields_test.go | Tests metadata validation rules. |
| internal/metadata/formats_test.go | Tests EPUB, FB2, and PDF behavior. |
| internal/metadata/pdf.go | Stops treating creation date as publication date. |
| internal/notices/notices_test.go | Tests bundled notice archives. |
| internal/ocrruntime/runtime_test.go | Tests OCR extraction and installation. |
| internal/settings/settings_test.go | Tests settings defaults and persistence. |
| internal/store/store_test.go | Tests drafts, caching, and migrations. |
| internal/webui/js/app.js | Loads cached matches on selection. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+473
to
+484
| body := `{"id":` + mustJSON(t, id) + `,"query":"Cacheable title"}` | ||
| response = request(t, server.Handler(), http.MethodPost, "/api/search", body, "application/json") | ||
| if response.Code != http.StatusOK { | ||
| t.Fatalf("search failed: %d %s", response.Code, response.Body.String()) | ||
| } | ||
| response = request(t, server.Handler(), http.MethodPost, "/api/search/cached", `{"id":`+mustJSON(t, id)+`}`, "application/json") | ||
| if response.Code != http.StatusOK { | ||
| t.Fatalf("cached search failed: %d %s", response.Code, response.Body.String()) | ||
| } | ||
| if catalogue.callCount() != 1 { | ||
| t.Fatalf("cached selection triggered catalog request; calls = %d", catalogue.callCount()) | ||
| } |
| parts := strings.Split(filename, " - ") | ||
| if len(parts) >= 3 && filenameVolume.MatchString(strings.TrimSpace(parts[1])) { | ||
| series := strings.TrimSpace(parts[0]) | ||
| title := strings.TrimSpace(strings.Join(parts[2:], " - ")) |
Comment on lines
+42
to
+46
| if key == "rating" { | ||
| rating := Text(value) | ||
| number, err := strconv.ParseFloat(rating, 64) | ||
| if err != nil || !comicRatingPattern.MatchString(rating) || number < 0 || number > 5 { | ||
| return fmt.Errorf("ComicInfo rating must be a decimal between 0 and 5 with at most two fractional digits") |
Comment on lines
+187
to
+188
| catalogs, or **Ignore cache** to run a fresh search. Cache duration and size are | ||
| configurable. Catalog results can describe a different edition; Open Library |
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.


• Load cached catalog matches when selecting a book and improve series inference.
• Align CBZ metadata reading, writing, and validation with ComicInfo v2.0; handle EPUB 2 contributor roles and PDF publication dates correctly.
• Add regression tests for metadata formats, catalog matching, application workflows, persistence, settings, CLI options, desktop behavior, and OCR runtime handling.
• Run Go tests in CI and update user, build, maintainer, and architecture documentation.