Commit Graph
1095 Commits
Author SHA1 Message Date
Dark-Alex-17 8752a85db5 feat(readarr): fetch Readarr author history and expose it on the CLI
Add the GetAuthorHistory event, backed by GET /history/author?authorId=N,
which returns a flat array of history records for a single author. The
fetcher mirrors the artist-history equivalent, sorting by id and carrying
the sort-prompt route guard so a refresh landing while the sort prompt is
open cannot clobber an in-progress sort selection.

Expose it as `readarr list author-history --author-id N`.
2026-08-27 11:11:24 -06:00
Dark-Alex-17 9572b68f97 feat(readarr): refresh all Readarr authors and expose the command on the CLI
Posts the RefreshAuthor command to the command endpoint with no author ID, which is how Readarr distinguishes a library wide refresh from a single author refresh. The response is returned verbatim and no app state is mutated.
2026-08-27 10:50:53 -06:00
Dark-Alex-17 c82006862e feat(readarr): refresh and rescan a Readarr author and expose the command on the CLI
Posts the RefreshAuthor command to the command endpoint with the author ID, queueing a metadata refresh and a disk scan for that author. The response is returned verbatim and no app state is mutated.

Adds the refresh subcommand group to the Readarr CLI.
2026-08-27 10:43:37 -06:00
Dark-Alex-17 e9b9aa3a14 feat(readarr): trigger automatic author searches and expose the command on the CLI
Posts the AuthorSearch command to the command endpoint with the author ID, queueing an indexer search for that author. The response is returned verbatim and no app state is mutated.

Introduces ReadarrCommandBody, the request body shared by the author and book command calls. Both ID fields are omitted from the payload when absent rather than sent as null.
2026-08-27 10:35:04 -06:00
Dark-Alex-17 f896b65fd9 feat(readarr): toggle Readarr author monitoring and expose the command on the CLI 2026-08-27 10:09:04 -06:00
Dark-Alex-17 ac8a11233f feat(readarr): delete Readarr authors and expose the command on the CLI 2026-08-27 09:54:38 -06:00
Dark-Alex-17 fcfc29894e feat(readarr): edit Readarr authors and expose the command on the CLI 2026-08-27 09:43:07 -06:00
Dark-Alex-17 e514e9b6cc feat(readarr): add authors to Readarr and expose the command on the CLI 2026-08-26 17:17:41 -06:00
Dark-Alex-17 9238c1b9d2 feat(readarr): search for new Readarr authors and expose the command on the CLI 2026-08-26 16:57:26 -06:00
Dark-Alex-17 5042dbdb3a feat(readarr): fetch Readarr author details and expose them on the CLI 2026-08-26 14:35:46 -06:00
Dark-Alex-17 817fe4d135 test(readarr): add shared network test factories 2026-08-26 14:23:15 -06:00
Dark-Alex-17 84eba9beac feat(readarr): fetch Readarr authors and expose them on the CLI
Add ReadarrEvent::ListAuthors, mapping to GET /author, and wire it up as
`managarr readarr list authors`.

This is the first Readarr event that touches the library rather than
configuration, so it creates the library/authors module tree mirroring
Lidarr's library/artists layout.

list_authors mirrors Lidarr's list_artists, including the sort-prompt
route guard: a response landing while the user has the sort prompt open
must not clobber their in-progress sort selection. Both directions of
that guard are covered by tests.
2026-08-26 11:41:42 -06:00
Dark-Alex-17 e1be1df68a feat(readarr): delete Readarr root folders and expose the command on the CLI 2026-08-26 10:38:58 -06:00
Dark-Alex-17 3475660eb2 feat(readarr): add Readarr root folders and expose the command on the CLI 2026-08-26 10:31:40 -06:00
Dark-Alex-17 e8e3376327 feat(readarr): delete Readarr tags and expose the command on the CLI 2026-08-26 10:21:55 -06:00
Dark-Alex-17 b9fa3b36c0 feat(readarr): add Readarr tags and expose the command on the CLI 2026-08-20 22:47:41 -06:00
Dark-Alex-17 29186ea03c feat(readarr): fetch Readarr root folders and expose them on the CLI
Adds the GetRootFolders event backed by GET /rootfolder, storing the result
on the Readarr root folders table, and surfaces it as
"managarr readarr list root-folders".

Root folders reuse the shared RootFolder model. Readarr omits the
unmappedFolders key that the other servarrs return, and the field is
optional, so it deserializes to None without changing the shared type.

Only the read path is included here. Adding and deleting root folders
mutate the library layout, so they are left for separate work.
2026-08-20 22:32:16 -06:00
Dark-Alex-17 ce8c51b02f test(readarr): seed system app data so empty and failure assertions can fail
The system network tests asserted that queued events, disk space, logs,
version, tasks, and updates were empty against a default state that was
already empty. Those assertions passed even with the fetcher body removed,
so they reported coverage that did not exist.

Seeding a stale value first makes the empty response test prove the fetcher
replaces rather than merges, and makes the failure tests prove the update
closure never runs on a non-success response by pinning the exact seeded
value.

The assertion on the deserialized payload in the empty response test is
left alone: it reads the response body rather than app state, so it was
never vacuous.
2026-08-20 22:24:57 -06:00
Dark-Alex-17 0cc49089b6 test(readarr): seed profile and tag maps so empty and failure assertions can fail
The empty-response and failure tests asserted the maps were empty against a
default state that was already empty, so they passed even with the fetcher
body removed. Seeding a stale entry first makes the empty-response tests prove
the fetcher replaces rather than merges, and the failure tests prove the update
closure never runs on a non-success response.
2026-08-20 22:16:38 -06:00
Dark-Alex-17 1d8ccd7ff6 feat(readarr): fetch Readarr tags and expose them on the CLI 2026-08-20 22:06:23 -06:00
Dark-Alex-17 de41d6fef7 feat(readarr): fetch Readarr metadata profiles and expose them on the CLI 2026-08-20 22:04:38 -06:00
Dark-Alex-17 4a7cf922e8 feat(readarr): fetch Readarr quality profiles and expose them on the CLI 2026-08-20 22:02:34 -06:00
Dark-Alex-17 44d147ce37 feat(readarr): fetch Readarr queued events and expose them on the CLI
An empty array is a valid response when nothing is queued, so the empty case is covered by its own test.
2026-08-20 21:52:18 -06:00
Dark-Alex-17 ab3992c372 feat(readarr): trigger Readarr tasks and expose the command on the CLI
The task name is sent as the shared CommandBody, matching the Radarr, Sonarr, and Lidarr implementations. The response is returned verbatim and no app state is mutated.
2026-08-20 21:49:28 -06:00
Dark-Alex-17 bd0274411c feat(readarr): fetch Readarr tasks and expose them on the CLI
Adds ReadarrEvent::GetTasks backed by get_readarr_tasks, populating the
Readarr tasks table, and surfaces it as 'readarr list tasks'.
2026-08-20 21:36:37 -06:00
Dark-Alex-17 690a17e152 feat(readarr): fetch Readarr logs and expose them on the CLI
Adds ReadarrEvent::GetLogs backed by get_readarr_logs, which formats each
record into the Readarr logs list, and surfaces it as
'readarr list logs --events N'.

The --output-in-log-format branch reads the Readarr log lines, and is
covered by a test that pins that source so it cannot silently drift to
another servarr's data.
2026-08-20 21:33:57 -06:00
Dark-Alex-17 c6d729162a feat(readarr): fetch Readarr updates and expose them on the CLI
Adds ReadarrEvent::GetUpdates backed by get_readarr_updates, rendering the
update history into the Readarr updates view, and surfaces it as
'readarr list updates'.

Covers the case where an update record omits the changes key, which the
live instance returns for its most recent release.
2026-08-20 21:22:31 -06:00
Dark-Alex-17 e0e82e654e fix: tolerate update records that omit the changes list
The changes field was required, so a single record without it failed the
whole response and emptied the updates list. A live instance returns five
update records of which one has no changes key, so this is reachable rather
than theoretical.

This affects every servarr, since Update is shared.
2026-08-20 21:06:28 -06:00
Dark-Alex-17 97d67a6938 feat(readarr): fetch the Readarr security config and expose it on the CLI 2026-08-20 16:15:34 -06:00
Dark-Alex-17 1072585903 feat(readarr): fetch the Readarr host config and expose it on the CLI 2026-08-20 16:07:33 -06:00
Dark-Alex-17 520b422dcc feat(readarr): fetch Readarr disk space and expose it on the CLI
Add ReadarrEvent::GetDiskSpace, mapped to GET /diskspace, and
get_readarr_diskspace, which stores the result on ReadarrData for the
root folder and system views.

Surface it as `managarr readarr list disk-space`, matching the other
three servarrs.

Readarr returns a label field on some records that DiskSpace does not
model; serde drops it, so the CLI prints only the path and the free and
total space, as it does for the other three servarrs.
2026-08-20 15:49:56 -06:00
Dark-Alex-17 d8f171ec6f feat(readarr): fetch the Readarr system status and expose it on the CLI
Add ReadarrEvent::GetStatus, mapped to GET /system/status, and
get_readarr_status in the new readarr_network/system module. It stores
the version and start time on ReadarrData so the system view and the
tick refresh can read them.

Surface it as `managarr readarr get system-status`, matching the
Radarr, Sonarr, and Lidarr spelling of the same call. A `list status`
spelling would have made the same command a different verb on the
fourth servarr, which is a difference the user would have to remember
for no benefit.

Readarr instances answer /system/status with thirty keys; SystemStatus
models the two that are used and serde ignores the rest, as it does for
the other three servarrs.

This is the first ReadarrCommand variant, so ReadarrCliHandler now
reads its app and network fields.
2026-08-20 15:47:40 -06:00
Dark-Alex-17 cd341c3d71 feat(readarr): add the Readarr health check network call
Inhabit ReadarrEvent with its first variant, HealthCheck, mapped to
GET /health, and add get_readarr_healthcheck alongside the equivalent
Lidarr, Radarr, and Sonarr fetchers. The call is internal only and has
no CLI surface, matching the other three servarrs; it exists so that an
unreachable instance surfaces an error banner on tick.

The healthcheck fetcher lives in readarr_network/mod.rs rather than a
submodule, so its tests live in readarr_network_tests.rs next to the
resource() and NetworkEvent conversion tests, mirroring Lidarr.

MockServarrApi::build_for matched NetworkEvent by value with no Radarr
fallback arm. It compiled only while ReadarrEvent was uninhabited and
no value could reach it; the first variant makes the match non
exhaustive, so it now assigns the config to the Readarr server tab.
2026-08-20 15:44:07 -06:00
Dark-Alex-17 29f043f5c7 feat: scaffold Readarr support across the state, app, handler, UI, and CLI layers
Promote Route::Readarr from a unit stub to a tuple variant and wire Readarr
through every layer, mirroring the Lidarr tree. Readarr appears as a fourth
servarr tab and its library view renders the Authors table.

Adds ReadarrData and its modals, the tick and context clue modules, the
top-level ReadarrHandler, ReadarrUi with the Authors library view, and an
empty ReadarrCommand behind ReadarrCliHandler. The default port is 8787.

Promoting the route variant compiles cleanly without any of the arms that
give it behaviour, so all six of those sites are wired explicitly here:
App::on_tick, handlers::handle_events, handle_prompt_toggle,
ServarrContextClueProvider, ui(), and verify_config_present_for_cli. Each was
checked by removing the arm and confirming its covering assertion then fails.

ReadarrEvent and ReadarrCommand are both declared empty. They gain variants
alongside the network calls and CLI commands that use them, which keeps each
later change to a single function.

Adding the tab changes the rendered tab bar, so 13 existing snapshots
regenerate. The only delta in each is that single tab bar line.

This scaffold adds 24 dead_code warnings, all inside the Readarr tree and
none outside it. They clear as the handlers, UI, network events, and CLI
commands that consume these items land: block arrays awaiting their accepts
implementations and BlockSelectionState seeding, modal and state fields
awaiting their handlers, the CLI handler fields awaiting an inhabited command
enum, and the top-level handler fields awaiting sub-handlers. The count must
strictly decrease from here, so a later increase is a defect rather than
transient noise. The 12 pre-existing collapsible_match warnings are unrelated
and untouched.
2026-08-20 15:28:49 -06:00
Dark-Alex-17 4db9b92146 refactor: move shared servarr types into servarr_models
SystemStatus was declared three times, byte for byte identically, in
radarr_models, sonarr_models, and lidarr_models. MetadataProfile and the
Lidarr release download body were each declared in a single servarr module
despite having nothing servarr specific about them: MetadataProfile is an
id and name pair structurally identical to QualityProfile, which already
lives in servarr_models, and a download body of a guid plus an indexer id
is the generic form of that request.

Move all three into servarr_models, preserving that file's alphabetical
ordering, and drop the prefix from LidarrReleaseDownloadBody now that it is
no longer owned by one servarr.

RadarrReleaseDownloadBody and SonarrReleaseDownloadBody deliberately stay
where they are. Radarr's carries a movie id and Sonarr's carries optional
series, episode, and season fields, so the three types are not
interchangeable and only the Lidarr shape is the common one.

Behavior is unchanged. Every remaining edit is an import path update or the
rename at a call site.
2026-08-20 10:52:05 -06:00
Dark-Alex-17 a362add8f0 feat: updated gitignore to not include coyote memory or workspace config 2026-08-19 13:03:14 -06:00
Alex Clarke e779f70187 Merge pull request #63 from JMcCumberIO/fix/tui-idle-cpu-and-error-banners
Check / stable / fmt (push) Failing after 30s
Check / beta / clippy (push) Failing after 1m17s
Check / stable / clippy (push) Failing after 1m21s
Check / nightly / doc (push) Successful in 1m7s
Check / 1.95.0 / check (push) Successful in 1m9s
Test Suite / ubuntu / beta (push) Successful in 1m51s
Test Suite / ubuntu / stable (push) Successful in 1m52s
Test Suite / ubuntu / stable / coverage (push) Failing after 2m27s
Test Suite / macos-latest / stable (push) Has been cancelled
Test Suite / windows-latest / stable (push) Has been cancelled
fix: reduce TUI idle CPU and improve server error banners
2026-07-06 08:58:06 -06:00
Jonathan McCumberandClaude Sonnet 4.6 a9054d9a98 chore: cargo fmt --all
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-06 09:18:50 -05:00
Jonathan McCumberandClaude Sonnet 4.6 645ca19d76 fix: address reviewer feedback — rename scroll field to bool, relocate static, drop env var
- Rename `ui_scroll_tick_count: u64` → `should_text_scroll: bool` across all 33
  call sites; `on_ui_scroll_tick` now assigns true/false instead of 0/1
- Remove two now-redundant comments from `test_on_ui_scroll_tick`
- Move `WHITESPACE_RE` static declaration below module imports in network/mod.rs
- Remove `MANAGARR_TICK_RATE_MS` env var and its parsing helpers; `recv()`-based
  blocking already brings idle CPU to near-0, and tuning tick rate silently
  stretches the poll cadence — keep `DEFAULT_TICK_RATE_MS` const only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
2026-07-04 20:30:20 -05:00
Jonathan McCumberandClaude Sonnet 4.6 6f697f64f4 fix: revert draw gating; replace frame-count scroll with wall-clock timer
- Revert src/main.rs to draw-at-top-of-loop (original structure) so
  auto-scrolling is no longer coupled to event rate. Lock is released
  before blocking on recv() so the network task is never starved.

- Replace ticks_until_scroll counter in on_ui_scroll_tick() with an
  Instant + Duration (default 100ms). Scroll now advances at a fixed
  wall-clock rate (10 chars/sec) regardless of draw rate or tick rate,
  which is the correct long-term fix for the animation regression.

- Update tests: assert scroll_interval == 100ms in default/new tests;
  rewrite test_on_ui_scroll_tick to cover zero-interval (always fires)
  and long-interval (suppressed) cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3FpbniZme9mJqgFkMVowz
2026-06-30 20:05:00 -05:00
Jonathan McCumber a72b2991fd fix: address reviewer feedback — regex OnceLock and restore tick rate
- Compile whitespace regex once via OnceLock instead of on every
  non-success response; makes format_error_body infallible (String
  return, no Result) eliminating the only practical failure mode
- Revert default tick rate from 100ms back to 50ms to preserve the
  existing 20-second Servarr poll cadence (tick_until_poll=400 × 50ms);
  the recv() change is the real CPU fix — the tick rate change was
  unnecessary and silently halved the data refresh rate
- Keep MANAGARR_TICK_RATE_MS as opt-in override; note that tuning it
  proportionally stretches the poll interval alongside the tick rate
2026-06-28 13:00:16 -05:00
Jonathan McCumber 6c41e0704e fix: reduce TUI idle CPU and improve server error banners
- Replace non-blocking try_recv() event loop with blocking recv() to
  eliminate idle spin; the sender tick timeout still drives minimum
  wakeup rate so the UI stays responsive
- Lower default tick rate from 50 ms to 100 ms (10 ticks/sec vs 20);
  add MANAGARR_TICK_RATE_MS env var for runtime tuning
- Move terminal draws to event boundaries (key + tick) instead of every
  loop pass, reducing unnecessary redraws
- In network error handling, prefer concise JSON fields (message /
  errorMessage / error) over the raw HTTP body, so Radarr ASP.NET
  stack traces don't flood the TUI banner; full body still logged
- Add unit tests for tick-rate parsing and Radarr-style JSON error body

Observed: ~0.6% total CPU at idle vs measurably higher with prod defaults
2026-06-28 12:35:37 -05:00
Dark-Alex-17 6e7707f6df build: upgraded MSRV in the Dockerfile 2026-06-25 15:41:56 -06:00
github-actions[bot] a26444006b chore: bump Cargo.toml to 0.7.3
Check / stable / fmt (push) Failing after 27s
Check / beta / clippy (push) Failing after 1m13s
Check / stable / clippy (push) Failing after 1m15s
Check / nightly / doc (push) Successful in 1m3s
Check / 1.95.0 / check (push) Successful in 1m9s
Test Suite / ubuntu / beta (push) Successful in 1m47s
Test Suite / ubuntu / stable (push) Successful in 1m47s
Test Suite / ubuntu / stable / coverage (push) Failing after 2m24s
Test Suite / macos-latest / stable (push) Has been cancelled
Test Suite / windows-latest / stable (push) Has been cancelled
2026-06-25 20:58:11 +00:00
github-actions[bot] ccf3e28323 bump: version 0.7.2 → 0.7.3 [skip ci] 2026-06-25 20:58:10 +00:00
Alex Clarke 6eea6b92fb Merge pull request #62 from Dark-Alex-17/develop
Security fixes, rolling logs, and Rust version upgrade
2026-06-25 14:37:16 -06:00
Dark-Alex-17 6df68b8a66 tests: Addressed additional CR comments and added tests for tail-logs 2026-06-25 14:21:57 -06:00
Dark-Alex-17 cbca6bd916 fix: addressed code review comments 2026-06-25 14:11:18 -06:00
Dark-Alex-17 92187c5f16 fix: tail-logs subcommand follows log rollovers and sleeps to minimize idle CPU loops 2026-06-25 13:51:32 -06:00
Dark-Alex-17 366809d8c6 fmt: applied formatting 2026-06-25 13:32:31 -06:00