Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
folder_output_pathdecided whether the output pattern had an extension by looking at the substituted name. If the input stem contains a dot, that stem looks like an extension:clip.v2.mkvwith pattern{original}_restoredgaveclip.v2_restored, with no.mkv. Its "suffix" is.v2_restored, so the input extension was never added and the encoder got a path with no real container extension.a.b.pngwith pattern{original}_restoredgavea.png.with_suffixreplaced.b_restored, so the pattern text was lost, anda.b.pnganda.c.pngboth mapped to the same output.This affects the CLI folder mode, image restore, and the GUI queue/processor, which all call this helper.
Fix: take the extension from the pattern itself (with
{original}removed) rather than from the result. Patterns with and without an extension behave as before for undotted names.Tests: I added three cases to
TestFolderOutputPathintests/test_media_files.py. The two dotted-stem cases fail onmainand pass with the fix, and all 14 tests in the file pass.AI-assistance note: I found and wrote this change with help from an AI coding assistant. I reviewed it and ran the tests myself.