Skip to content

feat(authors): add configurable monitor defaults#809

Merged
vavallee merged 3 commits into
vavallee:mainfrom
magrhino:codex/add-author-defaults
May 26, 2026
Merged

feat(authors): add configurable monitor defaults#809
vavallee merged 3 commits into
vavallee:mainfrom
magrhino:codex/add-author-defaults

Conversation

@magrhino
Copy link
Copy Markdown
Contributor

@magrhino magrhino commented May 24, 2026

Summary

Adds configurable author monitor modes so users can add or edit authors without automatically monitoring every back-catalogue title. This closes the primary author-level workflow requested in #792 while leaving per-series monitoring as a separate follow-up request. Closes #792.

  • Adds per-author monitor mode fields for all books, future books only, latest N books, and none, including migration defaults that preserve existing behaviour.
  • Applies monitor modes when author works are fetched, avoids auto-searching books that the selected mode leaves unmonitored, and supports applying an edited mode to existing books.
  • Adds settings/API validation for global author monitor defaults and wires the add/edit author UI to those defaults.
  • Documents the feature in README.md.

Follow-ups (not in this PR)

Per-series monitor selection is intentionally deferred and should be tracked in a separate feature request.

Checklist

  • Tests added or updated
  • docs/DEPLOYMENT.md updated if env vars, config, or upgrade path changed - N/A, no deployment/config/upgrade change
  • CHANGELOG.md [Unreleased] section updated - N/A, release-time only per AGENTS.md
  • Wiki pages updated if user-facing behaviour changed - README feature surface updated and no author-monitor wiki page exists

Test plan

  • gofmt -l internal/api/authors.go internal/api/authors_test.go internal/api/settings_handler.go internal/api/settings_handler_test.go internal/db/authors.go internal/db/authors_test.go internal/models/author.go
  • go vet ./...
  • golangci-lint run --timeout=5m with repo-pinned v2.11.4
  • govulncheck ./...
  • go test ./cmd/... ./internal/...
  • cd web && npm run lint
  • cd web && npm run typecheck
  • cd web && npm run build
  • cd web && npm test

@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 71.06599% with 57 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/api/authors.go 71.33% 26 Missing and 19 partials ⚠️
internal/models/author.go 0.00% 6 Missing ⚠️
internal/api/settings_handler.go 63.63% 2 Missing and 2 partials ⚠️
internal/db/authors.go 91.30% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@vavallee vavallee merged commit 96b0cba into vavallee:main May 26, 2026
31 checks passed
vavallee added a commit that referenced this pull request May 26, 2026
…o 045) (#832)

PR #809 (author monitor modes) and PR #700 (per-media-type download
categories) both shipped a migration numbered 043, landing on main
within the same release window. The migration runner keys on the
numeric version: it iterates files in name order, computes version
from filename, checks schema_migrations for that version, and SKIPS
when already applied. With two files at version 043, the second one
encountered alphabetically would be silently skipped on any DB that
had already applied the first — losing the author_monitor_mode schema
on every existing install during the next upgrade.

This was caught before any tagged release shipped, so no production
DB has been corrupted. Renaming 043_author_monitor_mode.sql to
045_author_monitor_mode.sql restores monotonic numbering. The newer
migration (calibre_import_rollback) stays at 044.

The author_monitor_mode.sql SQL itself is unchanged.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
vavallee added a commit that referenced this pull request May 26, 2026
* feat(authors): per-series monitor mode (#810)

Extends #809 with a fifth author MonitorMode, "series", that pins
monitoring to a user-selected subset of the author's series. Books linked
to a pinned series are monitored; everything else is unmonitored and
skipped by Wanted/auto-search. Excluded books still win over series
membership.

Schema: new 046 migration adds an author_monitored_series join with
CASCADE on both sides. Per the issue's explicit guidance the pin set is
NOT overloaded onto series.monitored, which is the global watchlist
flag and would silently flip state for unrelated authors.

API:
  - GET /author/{id} returns monitoredSeriesIds when mode == series
  - PUT /author/{id} accepts monitoredSeriesIds: number[] and rejects
    ids that don't belong to the author (a foreign series id would
    have silently pinned monitoring to an unrelated catalog row)
  - new GET /author/{id}/series backs the picker
  - global author.default_monitor_mode rejects "series" — per-author
    only

Apply-mode pass loads the pinned set + bulk book->series map once
(avoids N+1) and applies series membership to every existing book.
Newly-discovered books in series mode default to unmonitored unless
the provider's SeriesRefs already match a pinned series at ingestion
time, so the user doesn't have to re-apply after every refresh.

Frontend: EditAuthorModal lazy-loads the author's series only when
series mode is picked, renders a checkbox list with a warning chip
when a selected series has no Hardcover link. Strings via t() with
en.json fallbacks.

Hardcover series-fill auto-trigger from the apply path is deferred:
the existing fill helpers are SeriesHandler methods and pulling them
into AuthorHandler would require a service refactor beyond the scope
of this PR. Users can still hit "Fill" on each series page.

Closes #810

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(test): drop unknown createdAt on Series literals in EditAuthorModal test

The Series interface in web/src/api/client.ts does not have a createdAt
field — that lives only on SeriesHardcoverLink. Two test literals in
the new series-picker smoke test set createdAt on the outer Series
object, which compiled fine in the local IDE but tsc --noEmit caught
the unknown property and CI's validate (frontend) + smoke jobs failed.

Inner hardcoverLink.createdAt stays — that one is correctly typed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@vavallee vavallee mentioned this pull request May 26, 2026
5 tasks
vavallee added a commit that referenced this pull request May 26, 2026
Feature release. Six feature drops plus a sweep of fixes for
default-install breaks that v1.14.2 didn't catch.

Features:
- Editable Quality Profiles (#768)
- Configurable author monitor modes incl. per-series (#792, #809, #810)
- Bulk multi-select on Author detail (#791)
- Per-media-type download client category (#700)
- Calibre import/sync rollback (#643)
- Edit existing Prowlarr connection with key propagation (#820)
- Hardcover series refs in list sync (#805)

Fixes:
- OpenLibrary 403 due to missing UA contact (#834)
- qBit Windows backslash path normalization (#800 follow-up)
- qBit case-mismatch detection after PathRemap (#800 follow-up)
- qBit import diagnostics + path-not-found detection (#824)
- Docker-host firewall named in ECONNREFUSED hint
- Grimmory configuration-only banner + key now optional (#818)
- Migration 043 collision hotfix (#832)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
vavallee added a commit that referenced this pull request May 26, 2026
Feature release. Six feature drops plus a sweep of fixes for
default-install breaks that v1.14.2 didn't catch.

Features:
- Editable Quality Profiles (#768)
- Configurable author monitor modes incl. per-series (#792, #809, #810)
- Bulk multi-select on Author detail (#791)
- Per-media-type download client category (#700)
- Calibre import/sync rollback (#643)
- Edit existing Prowlarr connection with key propagation (#820)
- Hardcover series refs in list sync (#805)

Fixes:
- OpenLibrary 403 due to missing UA contact (#834)
- qBit Windows backslash path normalization (#800 follow-up)
- qBit case-mismatch detection after PathRemap (#800 follow-up)
- qBit import diagnostics + path-not-found detection (#824)
- Docker-host firewall named in ECONNREFUSED hint
- Grimmory configuration-only banner + key now optional (#818)
- Migration 043 collision hotfix (#832)

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

"Monitor new books only" option for authors (Sonarr-style future monitoring)

2 participants