Skip to content

fix(importer): merge all PAR2 index files and group RAR archives by base name - #406

Merged
javi11 merged 1 commit into
mainfrom
fix/par2-multi-set-descriptor-merge
Mar 11, 2026
Merged

fix(importer): merge all PAR2 index files and group RAR archives by base name#406
javi11 merged 1 commit into
mainfrom
fix/par2-multi-set-descriptor-merge

Conversation

@javi11

@javi11 javi11 commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • PAR2 fix: GetFileDescriptors now reads all small PAR2 index files (≤5 segments) and merges their descriptors by Hash16k, instead of picking the single smallest file. Releases with multiple PAR2 sets (e.g. main archive + sample) previously returned only the sample's 1-entry map, leaving 46+ archive files with obfuscated names unmatched.
  • RAR grouping: ProcessArchive now groups RAR files by base name before calling AnalyzeRarContentFromNzb, so NZBs containing multiple separate RAR archives (main + sample) are analysed independently rather than mixing their parts.
  • New helper: GroupArchivesByBaseName extracted to aggregator.go (exported, tested) and extractRarBaseName added to utils.go.

Test plan

  • go test ./internal/importer/archive/rar/... — new TestGroupArchivesByBaseName passes
  • go test ./internal/importer/... — all existing tests pass
  • Release with 47-file main PAR2 + 1-file sample PAR2 now renames all archive files correctly without needing SRR

🤖 Generated with Claude Code

…ase name

Read all small PAR2 index files (≤5 segments) and merge their descriptors
instead of picking the single smallest file. Releases with multiple PAR2
sets (e.g. main archive + sample) previously returned only the sample's
1-entry map, leaving 46+ archive files unmatched and unrenaming. Deduplicates
by Hash16k so identical descriptors across set files are not duplicated.

Also groups RAR archive files by base name before passing to AnalyzeRarContentFromNzb,
so NZBs containing multiple separate RAR archives (e.g. main + sample) are
analysed independently rather than mixing their parts together.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11
javi11 merged commit 4769241 into main Mar 11, 2026
2 checks passed
yoshitaka420 pushed a commit to yoshitaka420/altmount that referenced this pull request Jun 1, 2026
…ase name (kipsilabs#406)

Co-authored-by: Claude Sonnet 4.6 <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