Skip to content

feat(api): add skip_arr_notification option to POST /import/file#521

Merged
javi11 merged 14 commits intomainfrom
claude/optimistic-jones-bf1ff3
Apr 20, 2026
Merged

feat(api): add skip_arr_notification option to POST /import/file#521
javi11 merged 14 commits intomainfrom
claude/optimistic-jones-bf1ff3

Conversation

@javi11
Copy link
Copy Markdown
Owner

@javi11 javi11 commented Apr 19, 2026

Summary

  • Adds skip_arr_notification boolean field (default false) to the POST /import/file request body — callers that set it to true suppress ARR notifications for that specific import
  • When the flag is set the handler encodes {"skip_arr_notification":true} into ImportQueueItem.Metadata using the existing JSON metadata pattern (same approach as nzbdav_id, extracted_files)
  • The post-import coordinator checks the flag in HandleSuccess before calling notifyARRWith; a skipped notification is logged at DEBUG with queue_id and path

What changed

File Change
internal/api/types.go SkipArrNotification bool added to ManualImportRequest (omitempty → backward-compatible)
internal/api/import_handlers.go Encodes flag into queue item metadata; warns via slog if marshal fails
internal/api/import_handlers_skip_arr_test.go Unit tests for encoding logic
internal/importer/postprocessor/coordinator.go shouldSkipARRNotification helper + HandleSuccess wiring
internal/importer/postprocessor/coordinator_skip_arr_test.go 6-case unit test for helper + integration test for HandleSuccess skip path

No database migration needed — uses the pre-existing Metadata *string JSON field.

Test Plan

  • go test ./... -race passes (all packages green)
  • POST /import/file with "skip_arr_notification": false (or omitted) — ARR notification fires as before
  • POST /import/file with "skip_arr_notification": true — logs ARR notification skipped (requested by caller) at DEBUG, no ARR scan triggered

javi11 added 7 commits April 19, 2026 19:35
…xt etc)

The propagation loop was marking every non-PAR2 file as IsRarArchive=true
when the NZB type was RarArchive, even files with no RAR magic bytes and no
RAR extension (.txt, .nfo sidecars).  These files were then routed to
ProcessArchive and failed the import.

Gate propagation on the file already being detected as an archive via the
existing fileinfo.IsRarFile / Is7zFile functions or magic-byte detection
(f.IsRarArchive / f.Is7zArchive).  Extract into propagateArchiveType for
testability.

Reproducer: Fresh.Off.the.Boat.S01E12...playWEB.nzb — .txt sidecar was
arriving at ProcessArchive.
@lostgit
Copy link
Copy Markdown

lostgit commented Apr 19, 2026

btw, with ARR service engine set to off, I still see

{"log":"time=2026-04-18T16:17:02.427-04:00 level=DEBUG msg=\"Could not find specific ARR instance for file, broadcasting scan\" component=postprocessor path=/mnt/fuse/complete/Movies/<snip> error=\"no ARR instance found managing file path: /mnt/fuse/complete/Movies/<snip>\"\n","stream":"stdout","time":"2026-04-18T20:17:02.427573422Z"}

@javi11
Copy link
Copy Markdown
Owner Author

javi11 commented Apr 19, 2026

Ok will tackle that in another pr

@javi11 javi11 merged commit c2b643f into main Apr 20, 2026
2 checks passed
@javi11 javi11 deleted the claude/optimistic-jones-bf1ff3 branch April 20, 2026 07:46
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