Skip to content

feat: Improve Obok book selection dialog #986

Open
ezuk wants to merge 3 commits into
noDRM:masterfrom
ezuk:master
Open

feat: Improve Obok book selection dialog #986
ezuk wants to merge 3 commits into
noDRM:masterfrom
ezuk:master

Conversation

@ezuk

@ezuk ezuk commented Apr 3, 2026

Copy link
Copy Markdown

The Obok SelectionDialog was a simple alphabetical list that became hard to navigate with large Kobo libraries. This adds three usability features:

  • Search box that live-filters by title, author, or series
  • Checkbox-based selection (replaces row-highlight) so selections persist across filter changes; Space key toggles the focused row
  • Manual hide system: "Hide Selected" persists hidden book IDs across sessions via plugin_prefs; "Show Hidden" reveals them again; books are auto-hidden when imported via OK
  • "In Library" toggle button filters to show only books whose titles already exist in the calibre library, for easy identification of duplicates to hide

Replaces the old "All with DRM" / "All DRM free" buttons with "Select All", "Deselect All", "Hide Selected", "Show Hidden", and "In Library".

ezuk added 2 commits April 3, 2026 14:22
… hide functionality

The Obok SelectionDialog was a simple alphabetical list that became hard
to navigate with large Kobo libraries. This adds three usability features:

- Search box that live-filters by title, author, or series
- Checkbox-based selection (replaces row-highlight) so selections persist
  across filter changes; Space key toggles the focused row
- Manual hide system: "Hide Selected" persists hidden book IDs across
  sessions via plugin_prefs; "Show Hidden" reveals them again; books are
  auto-hidden when imported via OK
- "In Library" toggle button filters to show only books whose titles
  already exist in the calibre library, for easy identification of
  duplicates to hide

Replaces the old "All with DRM" / "All DRM free" buttons with
"Select All", "Deselect All", "Hide Selected", "Show Hidden", and
"In Library".
@ElleKayEm

Copy link
Copy Markdown

Thanks for this. Seems very useful.

The "In Library" filter relied on exact lowercased title equality, which
silently missed a large share of duplicates as Kobo and calibre metadata
drifted apart. Rework matching into a dedicated, unit-tested module.

- Add Obok_plugin/title_match.py: title normalization (smart quotes, &,
  subtitle/parenthetical/edition handling) plus a LibraryMatcher that is
  author-first -- confirm the author(s) match (token-based; tolerant of
  order, "Last, First", separators; ignores ISBN-as-author junk; matches on
  a shared strong name token), then harmonize titles (exact form set,
  leading/trailing article, bounded Levenshtein fuzzy).
- dialogs.py: precompute in-library status once (not per keystroke); add a
  "Not in Library" toggle and open to it by default (the import-eligible
  diff); move verbose match diagnostics behind calibre's DEBUG flag.
- action.py: build the matcher from all calibre authors, not just the first.
- obok/obok.py: use raw strings for the MAC-address regexes to silence
  Python 3.12+ invalid-escape SyntaxWarnings (no behavior change).
- Add tests/test_obok_title_match.py (30 cases) and repo-root pytest.ini;
  rebuild the bundled plugin zip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants