Skip to content

feat(arrs): optimize blocklist precision with local database lookups#760

Open
drondeseries wants to merge 1 commit into
javi11:mainfrom
drondeseries:feat/arrs-optimize-blocklist
Open

feat(arrs): optimize blocklist precision with local database lookups#760
drondeseries wants to merge 1 commit into
javi11:mainfrom
drondeseries:feat/arrs-optimize-blocklist

Conversation

@drondeseries

@drondeseries drondeseries commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR optimizes blocklisting precision for Sonarr/Radarr integrations in Altmount by checking local database import records in addition to active download queues.

Detailed Changes

  1. Scanner DB Lookup: Updates the Sonarr/Radarr scanner (internal/arrs) to query the local database database for mapped download IDs associated with target file paths, resolving edge cases where history records were otherwise lost/not found in the active client queues.

@drondeseries

Copy link
Copy Markdown
Contributor Author

I have updated the PR to resolve the questions around import_history transience:

  • Moved Tracking to file_health Table: Added a dedicated download_id column to the file_health table. This serves as the persistent database layout for tracking library files and mapping them to ARR download/NZB IDs independent of the transient import_history.
  • Database Migration & Backfill: Added database migration 035_add_download_id_to_file_health.sql for both Postgres and SQLite. The migration automatically backfills existing file_health entries using matching paths from the import_history table (if history hasn't been cleared yet).
  • Import & Webhook Integration: Updated AddFileToHealthCheckWithMetadata and BatchAddFileToHealthCheck to store download_id upon initial import and webhook triggers.
  • Removed History Dependency in Sync: Cleaned up the sync safety check so it relies on the active library records rather than history.

@drondeseries drondeseries force-pushed the feat/arrs-optimize-blocklist branch 2 times, most recently from 3310ca2 to e3eb8e6 Compare July 6, 2026 15:23
@drondeseries

Copy link
Copy Markdown
Contributor Author

I have pushed the updated clean commits branch on top of upstream main. Here is the full breakdown of the 6 commits included in this PR and what they address:

  1. feat(arrs): optimize blocklist precision... (8dfacbe):

    • What it does: Optimizes blocklisting checks in the Sonarr/Radarr scanner (internal/arrs) by checking local database records in addition to active download queues.
  2. chore: add local IDE and scanner... (bddfd4f):

    • What it does: Updates .gitignore to exclude assistant and semantic indexing directories (.antigravitycli, .codegraph, .medusa) from dirtying the git status.
  3. feat(health): implement streaming failure masking... (7b69972):

    • What it does: Prevents minor or transient network/article errors from immediately triggering repair loops. It introduces a configurable threshold (failure masking) before marking a streaming failure as corrupted.
  4. fix(quota): restore provider quota... (5266351):

    • What it does: Corrects NNTP provider quota display issues, ensuring automatic quota resets and database persistence operate cleanly.
  5. fix(importer): normalize multi-volume archives... (56322a6):

    • What it does: Handles imports of obfuscated multi-volume archive sets without PAR2 metadata by correctly resolving file numbering sequences.
  6. feat(health): persist download_id in file_health... (e3eb8e6):

    • What it does: Decouples the health and repair system from the transient import_history table. It introduces a persistent download_id column to the file_health table, allowing users to prune their import history (e.g., via HistoryRetentionDays) without breaking ARR automatic repairs. Includes automatic database migration backfills from existing history records.

@drondeseries drondeseries changed the title feat(arrs): optimize blocklist precision with local db lookups, soft deletes, and history persistence feat(health): persist download_id in file_health and optimize blocklist precision Jul 6, 2026
@drondeseries drondeseries force-pushed the feat/arrs-optimize-blocklist branch from e3eb8e6 to d8d12ce Compare July 6, 2026 15:26
@drondeseries drondeseries changed the title feat(health): persist download_id in file_health and optimize blocklist precision feat(arrs): optimize blocklist precision with local database lookups Jul 6, 2026
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