Repository navigation
feat(autoscan): pluggable scan-source autoscan category (Sonarr/Radarr) - #44
Merged
Quick104 merged 118 commits intoJun 6, 2026
Merged
Conversation
Periodic poller over autoscan-enabled Radarr/Sonarr instances (reusing request_integrations) that maps import paths to Silo media folders and enqueues targeted scans via the existing scantrigger + scanqueue. Lean single-service model: no cross-node fan-out guard or retry queue. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds ErrIntegrationNotFound sentinel (errors.Is) instead of string matching. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ure trigger on interval change; skip source on key-resolution error Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…p, boundary-safe rewrites, GREATEST cursor guard, async trigger, quiet unresolved-path skip, FK->404 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…rs, re-seed source editor on save Addresses minor code-review findings: Windows backslash paths now normalized before rewrite/dedupe; HandleStatus returns repository errors instead of 200; the per-source editor re-seeds from server data after a save. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add suggestRewrites / commonSuffixLen for Task 1 of the autoscan arr-polling feature. Pure function: matches arr root-folder paths to Silo media folder paths by longest common trailing segment count, adjusted for depth-delta so coincidental same-named segments at different structural levels don't inflate confidence. Categorises each arr root as Proposed, Ambiguous, Unmatched, or Covered by an existing PathRewrite rule. TDD: test file written first, verified failing, then implementation added. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add GET /autoscan/sources/{id}/rewrite-suggestions admin endpoint: extend
the autoscanTriggerer interface with SuggestRewrites, wire SetRewriteResolvers
in the router, and add handler + test.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…p no-op suggestions Addresses final-review edge cases: coveredBy normalizes the existing rewrite's From (so a stored Windows/dup-slash rule still covers a root); duplicate arr roots and duplicate Silo folder paths are de-duplicated; an arr path that already equals its Silo path is not proposed as a no-op rewrite. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace the sourceNames Map plumbing in ActivityPanel with SourceLabelLookups and delegate both name functions to resolveEventSourceName from @/lib/autoscanLabels, enabling the full label chain (operator label → connection name → manifest display_name → capability_id) for all Scan History and Poll log rows.
Final-review follow-ups: add the label field to the autoscanStatusSource response (and AutoscanStatusSource type) so the status view matches the source response per spec, and give pollSourceName a non-empty fallback for symmetry with scanSourceName. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the legacy capability-only sourceLabel() helper with resolveSourceName() (operator label -> connection -> display_name -> capability). Row controls now announce the row's resolvedLabel (reflecting in-progress edits) and the delete dialog announces the resolved name, so screen readers hear "4K Movies" instead of "arr (plugin Silo-Server#4)". Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the card/table hybrid and 200-row "Load more" cap on the autoscan Activity panel with proper tables and real pagination. Backend: add offset + total-count to the scans/events list endpoints so history pages through the full set instead of a capped window. Extract shared event/scan WHERE-clause builders so list and count filter identically, and add CountEvents / CountAutoscanScans. Frontend: add a reusable TablePagination component (rows-per-page, "showing X-Y of Z", numbered window with ellipses, responsive) and reuse it for the server-paginated history (scans + polls) and the client-paginated live queue. Unify all three tables behind one DataTable shell so they read as one family. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Quick104
added a commit
that referenced
this pull request
Jun 6, 2026
Summary
Adds Autoscan: a standalone admin category that watches Sonarr/Radarr (and, in future, any provider) for imports + renames and triggers targeted library rescans, so new media appears without waiting for a full scan.
Change-detection is pluggable via the new
scan_source.v1capability (merged insilo-plugin-sdk#2). The host owns the timer, marker storage, path rewrites, scan enqueueing, and the admin UI; an out-of-process plugin (the Sonarr/Radarr provider, separate repo) just polls arr and returns raw changed paths. This PR is the host half (silo-server).Architecture
scan_sourcecapability × connection (many per plugin). Per-source rewrites with a "Sync from arr" suggester (matches arr root folders to Silo media folders). Auto-discovered; enable requires a bound connection.What's in this PR (host)
internal/autoscan/— engine (poll → rewrite → resolve → suppress → enqueue → marker), repository, connection resolver, provider seam, discovery, host-side rewrite suggester, connection probe.internal/pluginhost+internal/plugins—scan_source.v1client wrapper + service resolver.internal/api/handlers/autoscan.go+autoscan_wiring.go+router.go— admin API (settings, connections, sources, scan-source-plugins, trigger, status, connection-test, rewrite-suggestions).migrations/171_autoscan.up.sql— single clean v2 schema (the prior in-process autoscan never shipped tomain, so its migration was collapsed, not migrated).web/src/pages/AdminAutoscan.tsx+pages/admin/autoscan/*+ hooks/types — the Autoscan admin category.cmd/silo/main.go— poll task wiring.go.mod— depends on the mergedsilo-plugin-sdk(scan_source.v1) via pseudo-version; bump to a tagged release when one is cut.Dependencies / multi-repo
silo-plugin-sdk—scan_source.v1is merged (Add online recap and preview marker support #2). This PR consumes it.Silo-Server/silo-plugin-autoscan-arrrepo + asilo-pluginscatalog entry. Without an installed scan-source plugin, the Autoscan page shows an empty "install a plugin" state — the host degrades gracefully.Known follow-up (intentionally out of scope)
Arr API keys are stored plaintext at rest in
autoscan_connections.api_key_ref— consistent with the existingrequest_integrationspattern (Requests stores its arr keys plaintext too;silo-serverhas no Fernet/secret store). This is a repo-wide property, not an autoscan regression. Encrypting arr credentials at rest (a shared secret store for both Requests and autoscan) is tracked as a separate cross-cutting security item.Test plan
go build ./...+go test ./...green (run in a libvips-equipped env —internal/api/*link libvips via CGO).webbuilds; no new frontend test failures vs baseline./code-review max(credential dead-seam, unbind no-op, marker data-loss, history truncation, migration backfill, +more — all fixed).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests