Skip to content

Add support for gzip-compressed NZB files (.nzb.gz)#530

Merged
javi11 merged 1 commit intomainfrom
claude/support-gzipped-nzb-files-DCSF6
Apr 23, 2026
Merged

Add support for gzip-compressed NZB files (.nzb.gz)#530
javi11 merged 1 commit intomainfrom
claude/support-gzipped-nzb-files-DCSF6

Conversation

@javi11
Copy link
Copy Markdown
Owner

@javi11 javi11 commented Apr 23, 2026

Summary

This PR extends NZB file support to include gzip-compressed files (.nzb.gz) in addition to standard .nzb files across the application. A new utility function HasNzbExtension() was introduced to centralize and standardize NZB file extension validation.

Key Changes

  • New utility function: Added HasNzbExtension() in internal/importer/utils/nzbtrim/nzb_trim.go to check for both .nzb and .nzb.gz extensions (case-insensitive)
  • Backend validation updates: Replaced inline extension checks with the new utility function in:
    • internal/api/sabnzbd_handlers.go (file upload and URL download handlers)
    • internal/api/queue_handlers.go (queue upload handler)
    • internal/api/nzb_stremio_handlers.go (Stremio NZB handler)
    • internal/importer/scanner/directory.go (directory scanner)
    • internal/importer/scanner/watcher.go (directory watcher)
  • Frontend updates:
    • Updated file validation logic in frontend/src/components/queue/ImportMethods.tsx to accept both .nzb and .nzb.gz files
    • Updated file input accept attribute to include .nzb.gz
    • Updated user-facing error messages to reflect support for both formats

Implementation Details

  • The HasNzbExtension() function performs case-insensitive matching by converting filenames to lowercase before checking suffixes
  • All error messages have been updated to indicate support for both .nzb and .nzb.gz formats
  • The change is backward compatible and doesn't affect existing .nzb file handling

https://claude.ai/code/session_01JrGP2iwN5ekVfdjpbfRJja

Upload endpoints, the directory scanner, and the watcher only matched
the bare .nzb extension, so gzipped NZBs were rejected even though the
downstream openNzbFile helper already decompresses them transparently.
Centralize the extension check in nzbtrim.HasNzbExtension and apply it
across the HTTP handlers, scanner, watcher, and frontend upload input.
@javi11 javi11 merged commit b09b7db into main Apr 23, 2026
2 checks passed
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