fix(rar): fail fast on incomplete archives instead of falsely completing#613
fix(rar): fail fast on incomplete archives instead of falsely completing#613evulhotdog wants to merge 2 commits into
Conversation
|
but with this if the failing parts are in a file inside the rar that is not the video file it will make all the file fails |
|
@javi11 what do you think is a better path to address it? I do see the conversation in the issue I created. Maybe we can wait to see what happens there. |
ae982d1 to
c335e8f
Compare
|
@javi11 I don't like the hardcoded extensions, but I'm not sure what other way to tackle this... |
8693e5a to
8cb57b1
Compare
Three bugs caused altmount to falsely report NZBs as successfully imported when RAR volumes were missing from the Usenet server: 1. ValidateSegmentIntegrity checked against PackedSize (sum of found parts) instead of Size (uncompressed full file size from RAR header). When a volume is missing, PackedSize shrinks and validation incorrectly passes. 2. patchMissingSegment created overlapping fake segments with wrong offsets, falsely inflating perceived coverage without adding real data. 3. Validation failures in aggregator.go were silently skipped by returning nil instead of propagating the error. Changes: - common.go: validate against content.Size, fallback to PackedSize only if Size is unavailable - processor.go: fix patchMissingSegment to use correct StartOffset and SegmentSize - aggregator.go: return errors from both validation paths instead of nil Result: incomplete archives now fail during import with a clear error, allowing ARR apps to retry instead of trying to read a non-existent file.
8cb57b1 to
864cba8
Compare
|
So, if I understand well, what you will want is something like the allowed file extensions but that mark the file as failed if no video file is found available no? |
|
@javi11 yes, but still being validated through the normal mechanisms, so we don't fail on a sample, nfo, etc. but do fail on the main file. I don't know if there's a better path to go here. To salvage what we can. It also may be a moot workaround, if we can implement par2 repairs on the fly. |
|
Ok what I can do is, a setting to fail if the imported dosn't have any video file that is not a sample |
Three bugs caused altmount to falsely report NZBs as successfully imported when RAR volumes were missing from the Usenet server:
ValidateSegmentIntegrity checked against PackedSize (sum of found parts) instead of Size (uncompressed full file size from RAR header). When a volume is missing, PackedSize shrinks and validation incorrectly passes.
patchMissingSegment created overlapping fake segments with wrong offsets, falsely inflating perceived coverage without adding real data.
Validation failures in aggregator.go were silently skipped by returning nil instead of propagating the error.
Changes:
Result: incomplete archives now fail during import with a clear error, allowing ARR apps to retry instead of trying to read a non-existent file.