Skip to content

[reject_files_larger_than_original] v0.0.5: optional size tolerance - #513

Open
funkekaiser wants to merge 1 commit into
Unmanic:officialfrom
funkekaiser:pr-reject_files_larger_than_original
Open

[reject_files_larger_than_original] v0.0.5: optional size tolerance#513
funkekaiser wants to merge 1 commit into
Unmanic:officialfrom
funkekaiser:pr-reject_files_larger_than_original

Conversation

@funkekaiser

Copy link
Copy Markdown

Problem

The strict > size comparison interacts badly with remux-style worker tasks. Example from a real library: Apple HEVC's hev1→hvc1 codec-tag rewrite (-c:v copy -tag:v:0 hvc1 -movflags +faststart) relocates the moov atom and made a 476,042,676-byte file 39 bytes larger. This plugin rejected the result and reset the source file — but the task still completed "successful".

That combination is worse than a no-op: with "Ignore completed tasks" enabled (or this plugin's own ignore option), the file is now permanently blocked from ever receiving its intended change, and the rejection is invisible unless you read the task log. In our case ~50 remuxes per hour were being silently nullified this way.

Fix

Add an optional tolerance slider (percent, default 0 — behaviour completely unchanged unless the user opts in). With e.g. 1%, container-overhead growth passes while genuinely larger encodes (typically +10–30%) are still rejected.

Version bumped to 0.0.5 with a changelog entry.

🤖 Generated with Claude Code

Add an optional size tolerance (slider, default 0% = behaviour unchanged).

Remux-style worker tasks that only rewrite container metadata can grow a
file by a few bytes — e.g. Apple HEVC's hev1->hvc1 codec-tag rewrite with
'-movflags +faststart' relocates the moov atom and added 39 bytes on a
476MB file. With a strict greater-than comparison the plugin rejects the
result, and the task still completes 'successful' — so plugins like
'Ignore completed tasks' then permanently block the intended change from
ever being applied. A small tolerance lets users accept insignificant
container overhead while still rejecting genuinely larger encodes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@funkekaiser

Copy link
Copy Markdown
Author

Testing note (per CONTRIBUTING quality control): verified against Unmanic 0.4.0+e838573 (latest release + master, josh5/unmanic:latest) on a live ~17TB library: 4 concurrent file testers + 3 QSV workers. No new python files are introduced by this PR, only modifications to existing ones, so no new file headers were added. Happy to adjust anything to fit the process.

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