Skip to content

feat(providers): add Lidarr integration - #60

Merged
itz4blitz merged 7 commits into
itz4blitz:masterfrom
vbrzezina:feat/lidarr-integration
Oct 13, 2026
Merged

itz4blitz merged 7 commits into
itz4blitz:masterfrom
vbrzezina:feat/lidarr-integration

Conversation

@vbrzezina

@vbrzezina vbrzezina commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #57. That PR fixes *arr log-file ingestion, which this integration relies on. Only the last commit, feat(providers): add Lidarr integration, belongs to this PR. Please merge #57 first.

Summary

Adds a Lidarr integration (@logarr/provider-lidarr) on the shared provider-arr base, using Lidarr's v1 API.

  • v1 history: an ArrClient subclass for the v1 API reads history and history/since with includeArtist and includeAlbum.
  • Shared helpers: event resolution, severity and item ids use the shared provider-arr helpers from fix: *arr log file ingestion emits no entries (timestamp regex + context parser contract) #57 (resolveArrEventName, describeArrEvent, toArrItemId). The Readarr PR uses the same helpers and severity table, so the two behave the same.
  • History normalisation:
    • Covers every EntityHistoryEventType value (0–10, checked against Lidarr source). Numeric and camelCase event types are both accepted.
    • Severity:
      • downloadFailed and any unknown *Failed event are errors.
      • albumImportIncomplete is a warning.
      • Everything else is info.
    • Activity ids are stable: lidarr-history-<id>.
    • Artist-level events have no album id, so itemId is left unset rather than set to "0".
  • Health and queue: reuses the base implementation.
  • Log files: reuses the existing LIDARR_LOG_FILE_CONFIG to tail lidarr.txt.
  • Wiring:
    • backend registration;
    • env seeding with LIDARR_URL, LIDARR_API_KEY and LIDARR_LOGS_PATH, mounted at /lidarr-logs;
    • both Dockerfiles, the compose files and turbo.json env;
    • the Lidarr integration flipped to available, with a logs-page deep link;
    • README updates.

Testing

  • @logarr/provider-lidarr has 103 unit tests covering:
    • the v1 URL and X-Api-Key header, retries, and 401 handling;
    • health and queue handling, including partial failure;
    • event-type tables;
    • multi-line exception parsing under the fixed context-parser contract.
  • pnpm build, lint, typecheck and test all pass. pnpm install --frozen-lockfile is clean, and the lockfile diff only adds the new package.
  • Not yet tested against a live Lidarr instance.

…amps

*arr apps write log files with the NLog layout yyyy-MM-dd HH:mm:ss.f (a single
fractional digit), so real Sonarr/Radarr/Prowlarr/Whisparr lines did not match
the parser regex, which required exactly three digits, and were dropped or
treated as continuations.
LogFileProcessor finalizes the pending entry before asking the provider to
parse a new header line, as the parseLogLineWithContext contract in core
expects (Emby and others return the current entry). The *arr context parser
instead returned the previous entry and stashed the current one in the
caller's context, which the processor discards, so file-tailed Sonarr,
Radarr, Prowlarr and Whisparr logs produced no entries at all.

- parseArrLogLineWithContext now returns the current entry for header
  lines, flags continuations, and ignores blank lines (NLog writes one
  between a message and its exception)
- Exception extraction moves to finalizeArrLogEntry, invoked through a new
  optional finalizeLogEntry hook in LogFileProcessor; it strips the
  "[vX.Y.Z.W]" prefix so the exception type and message are populated
- End-to-end LogFileProcessor tests with real Sonarr and Emby providers
…re finalizeLogEntry on core provider interface
Add @logarr/provider-lidarr on top of the shared provider-arr base, using
Lidarr's v1 API.

- v1 ArrClient with history and history/since (includeArtist/includeAlbum)
- History normalization for all EntityHistoryEventType values, accepting
  numeric and camelCase event types; downloadFailed and unknown "*Failed"
  events are errors, albumImportIncomplete is a warning; stable
  lidarr-history-<id> activity ids
- Reuses the existing LIDARR_LOG_FILE_CONFIG for lidarr.txt file tailing
- Backend registration, env seeding (LIDARR_URL/LIDARR_API_KEY,
  /lidarr-logs), Dockerfiles, compose, turbo env
- Frontend: Lidarr integration flipped to available, logs deep link
- README updates
@vbrzezina
vbrzezina force-pushed the feat/lidarr-integration branch from 8f1fa6a to 9dd27c6 Compare October 10, 2026 18:46
@vbrzezina

Copy link
Copy Markdown
Contributor Author

Part of a set of integration PRs. Overview, merge order and design notes: #64

@vbrzezina
vbrzezina marked this pull request as ready for review October 12, 2026 16:43

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, and merging this after #57.

The Lidarr provider matches the Sonarr/Radarr shape: id lidarr, API v1, history events 0–10, log file lidarr.txt, registered in both ingestion.service.ts and servers.service.ts, and the frontend card is available with the standard API fields. I merged #57 first and checked the combined tree: ARR_LOG_EXCLUDE_PATTERNS stays on every *arr config, including Lidarr. Merging this branch by itself would have dropped that exclusion, because this branch does not contain 0808207.

Follow-up, not blocking: issue_source has no lidarr value, so Lidarr warn/error issues are stored as system. Whisparr, Emby, and Plex already take that path. Adding lidarr needs a migration.

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