Repository navigation
Skip Repeat Conversions and Keep Bitrate State Current - #1125
Conversation
The automatic process path skips ReEncode() and DeInterlace() when the file already carries ReEncoded or DeInterlaced, and logs a warning naming the tracks that still match. The explicit reencode and deinterlace commands still convert. Every bitrate measurement sets or clears BitrateExceeded, a repair that re-encodes measures the replaced media again, and a failed bitrate or packet analysis logs a warning instead of failing the file. A bitrate analysis ended by a tool error leaves Verified unset so the next run retries it, and a packet analysis tool error stops before the timestamp repair ladder runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the signal snapshot from VerifyBitrate(), since an FfProbe signal exit is recorded as a tool error. Test a re-encode repair whose bitrate re-measure hits a tool error and a remux repair after a bitrate tool error, and make the delete assertion meaningful by enabling DeleteInvalidFiles in the fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PR Summary by QodoSkip Repeat Conversions and Keep Bitrate State Current
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
🟢 Approval recommended
The review records no active issues as the basis for approval.
No open issues 🎉
What changed in this PR
This PR avoids repeat conversions during automatic processing and keeps bitrate verification state current across verification and repair paths.
Changes:
- Skips already re-encoded or deinterlaced media during conditional processing while preserving explicit command behavior.
- Tracks bitrate-analysis errors, updates
BitrateExceeded, and remeasures bitrate after re-encode repairs. - Adds regression tests for conversion guards, bitrate state transitions, repair behavior, and packet-analysis failures.
| File | Summary | Review findings |
|---|---|---|
PlexCleaner/ProcessFile.cs |
Implements conversion guards, bitrate-state management, retry handling, repair-tier behavior, and post-repair measurement. | Three moderate findings remain regarding retryable bitrate tool-error states, re-encode fallback after plain packet-analysis failure, and persistence on the explicit verify path. Two nit findings address comment grammar and reporting all matching interlaced tracks. |
PlexCleanerTests/ReEncodeBitrateStateTests.cs |
Adds fake-tool coverage for conditional versus explicit conversions, bitrate persistence, repair remeasurement, and analysis failures. | No final findings supplied. |
Review effort: Lite
Add FakeTools.WriteSampleToolData() and a seeded state parameter on FakeTools.CopyUnverifiedSample(), and move the new test class onto them. The other test classes that build the same setup move under #1124. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Qodo finding "2. New tests reparse state after copying": fixed in b18a288. |
Confirmed — finding 2, “New tests reparse state after copying,” is resolved by commit |
Summary
Implements the maintainer decisions recorded on #1076 and #1078.
Repeat conversions (#1076)
processpath (conditional),ReEncode()skips a file already carryingReEncoded, andDeInterlace()skips a file already carryingDeInterlaced. Each logs a warning naming the tracks that still match (Id:Format:Codec).reencodeanddeinterlacecommands (MkvProcess,conditionalfalse) still force the conversion, with the existing "already reencoded/deinterlaced" warning.FileModified, which clears both flags.Bitrate and packet analysis (#1078)
VerifyBitrate()setsBitrateExceededwhen the measurement exceedsMaximumBitrateand clears it when it does not.BitrateExceeded.Verifiedunset, so the next run verifies and measures again.SetRepairedState(), shared by the stream repair and the timestamp repair). The setts and remux tiers do not change the stream payload, so they do not re-measure.RepairTimestampsAndSetState()checks for a tool error right after the packet analysis and stops before the setts, remux, and re-encode tiers. A plain packet analysis failure logs a warning and falls back to the remux and re-encode tiers as before.Tests
PlexCleanerTests/ReEncodeBitrateStateTests.cscovers each path with fake tools:ReEncode()andDeInterlace()skip only when conditional, and convert again when explicit.BitrateExceeded, and the state persists to the next run.Verifiedunset and the next run verifies again.BitrateExceeded, and a tool error in that re-measure leavesVerifiedunset.Verifiedunset.PlexCleanerTests/FakeTools.csgainsWriteSampleToolData(directory)and a seededstateparameter onCopyUnverifiedSample()(defaultNone, existing callers unchanged), and the new test class uses both.The full suite passes locally (
dotnet test), and.NET Formatis clean.Deferred
The maintainer deferred the
HISTORY.mdlines and the removal of theARCHITECTURE.md"Suspect Branches" entries (S9, S11) and their diagram labels to one final docs pull request. This pull request changes no method name a diagram names, soArchitectureDiagramTestsneeds noARCHITECTURE.mdedit.Pre-existing findings, filed
SidecarRenameStateTests,ScanStateTests, andVerifyToolErrorTests(design, consolidation): these build the sample tool data fakes or seed the sidecar state by hand rather than through the newFakeToolshelpers. Moving them is outside this change's file claim. Filed as Consolidate Fake Tool Fixture Setup in FakeTools #1124.Labels
Carries the
commentslabel, since the change adds code comments that state a non-obvious why.Closes on promotion: #1076, #1078
🤖 Generated with Claude Code