You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guard ReEncode and DeInterlace Against Repeating on Every Run #1076
ProcessFile.ReEncode() warns "Reencoding already reencoded media" when ReEncoded is set, then re-encodes anyway. ProcessFile.DeInterlace() does the same with "Deinterlacing already deinterlaced media". When the output still matches the selection, the file is re-encoded on every run.
The output can still match in these cases:
the encoder output matches an entry in ReEncodeVideo or ReEncodeAudioFormats
the deinterlaced output keeps an interlaced metadata flag that any of the three tools reads
Reproduction shape
Configure ReEncodeVideo with an entry that also matches the configured FfMpeg output codec.
Process the same file twice. It is re-encoded both times.
Expected
A file whose flag is already set is not converted again for the same reason, or the step fails the file so the loop is visible.
Found while drawing the process command diagrams, ARCHITECTURE.md "Process Command Logic", suspect branch S9.
Decision from the maintainer (2026-10-30): on the automatic process path only (conditional), skip ReEncode() or DeInterlace() when ReEncoded or DeInterlaced is already set, and log a warning naming the tracks that still match. The explicit reencode and deinterlace commands still force a conversion.
Claim (backlog burndown round 3, fixed together with #1076 and #1078): branch feature/1076-1078-reencode-bitrate, files PlexCleaner/ProcessFile.cs, new PlexCleanerTests/ReEncodeBitrateStateTests.cs. HISTORY.md and the Suspect Branches prose in ARCHITECTURE.md are deferred to one final docs pull request. A diagram edit the CI diagram test requires goes in this pull request, with ARCHITECTURE.md held by one live group at a time.
Claim update (orchestrator adjudication, 2026-10-31): branch feature/1076-1078-reencode-bitrate now also holds PlexCleanerTests/FakeTools.cs, add-only (a WriteSampleToolData helper and a defaulted state parameter on CopyUnverifiedSample). The other call sites are left to #1124.
Activity
ptr727 commentedon Oct 31, 2026
Decision from the maintainer (2026-10-30): on the automatic
processpath only (conditional), skipReEncode()orDeInterlace()whenReEncodedorDeInterlacedis already set, and log a warning naming the tracks that still match. The explicitreencodeanddeinterlacecommands still force a conversion.ptr727 commentedon Oct 31, 2026
Claim (backlog burndown round 3, fixed together with #1076 and #1078): branch
feature/1076-1078-reencode-bitrate, filesPlexCleaner/ProcessFile.cs, newPlexCleanerTests/ReEncodeBitrateStateTests.cs.HISTORY.mdand the Suspect Branches prose inARCHITECTURE.mdare deferred to one final docs pull request. A diagram edit the CI diagram test requires goes in this pull request, withARCHITECTURE.mdheld by one live group at a time.ptr727 commentedon Oct 31, 2026
Claim update (orchestrator adjudication, 2026-10-31): branch
feature/1076-1078-reencode-bitratenow also holdsPlexCleanerTests/FakeTools.cs, add-only (aWriteSampleToolDatahelper and a defaulted state parameter onCopyUnverifiedSample). The other call sites are left to #1124.