Skip to content

feat(integrations): Audiobookshelf connection with post-import scan trigger - #807

Draft
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:feat/audiobookshelf-notify
Draft

feat(integrations): Audiobookshelf connection with post-import scan trigger#807
kevinheneveld wants to merge 1 commit into
Listenarrs:canaryfrom
kevinheneveld:feat/audiobookshelf-notify

Conversation

@kevinheneveld

Copy link
Copy Markdown
Contributor

What

Adds an Audiobookshelf integration so Audiobookshelf picks up books imported by Listenarr without a manual library scan.

  • Settings → Audiobookshelf: server URL, API token (encrypted at rest via ISecretProtector, redacted in API responses), target library picker (or "all book libraries"), Test Connection, Scan Now
  • "Update Audiobookshelf" action on the book detail view and series collection view — calls POST /api/libraries/{id}/scan on the Audiobookshelf server
  • Optional automatic scan after import: both import paths (download-client and manual upload) converge on ScanJobProcessor, which signals a debounced scheduler (15 s trailing-edge quiet window, 2 min cap) so a bulk import produces one scan instead of dozens

Why

Audiobookshelf's folder watcher relies on filesystem events (inotify). When the library sits on a network share or the two apps run on different hosts, those events never arrive and newly imported books stay invisible until a full manual scan. The Audiobookshelf API's library-scan endpoint is the reliable alternative (watcher-update is flaky, partial scan doesn't exist).

Notes

  • Outbound requests validate targets and follow redirects hop-by-hop via OutboundRequestSecurity (allowPrivateTargets: true), matching the Prowlarr import flow
  • New EF migration AddAudiobookshelfSettingsToApplicationSettings (4 nullable columns on ApplicationSettings)
  • ConfigurationService's Prowlarr methods moved verbatim to a ConfigurationService.Prowlarr.cs partial to stay under the 500-line architecture cap
  • Tests: 10 new (settings round-trip/secret preservation, HTTP client behavior incl. Bearer auth, library targeting, failure surfaces); full suite 1199 passing, frontend 392 passing

🤖 Generated with Claude Code

…rigger

Audiobookshelf's folder watcher relies on filesystem events, which never
arrive when the library sits on a network share or another host — books
imported by Listenarr then stay invisible until a manual library scan.

Adds an Audiobookshelf integration:
- Settings (Settings → Audiobookshelf): server URL, API token (encrypted
  at rest, redacted in API responses), target library, test connection
- "Scan Now" in settings plus "Update Audiobookshelf" actions on the
  book detail and series views, calling POST /api/libraries/{id}/scan
- Optional automatic scan after every import (downloads and manual
  uploads both converge on ScanJobProcessor); bursts are coalesced by a
  trailing-edge debounce (15 s quiet window, 2 min cap) so a bulk import
  triggers one scan
- When no library is configured, all libraries with media type "book"
  are scanned

Outbound requests validate the target and follow redirects hop-by-hop
via OutboundRequestSecurity with private targets allowed, matching the
Prowlarr import flow.

Moves the Prowlarr settings methods of ConfigurationService into a
partial (ConfigurationService.Prowlarr.cs) to keep the file under the
500-line architecture cap.

Co-Authored-By: Claude Fable 5 <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.

1 participant