Fix repeated text matching in audio and video clips#177
Conversation
There was a problem hiding this comment.
Code Review
This pull request initializes the match variable to None in the text-splitting loops of both clip and video_clip methods in funclip/videoclipper.py to prevent stale matches, and adds a new test suite to verify duplicate text matching. The review feedback identifies two issues in these loops: in clip, the log_append string contains unformatted placeholders, and in video_clip, log_append is constructed but never appended to the final message, causing warning logs to be lost.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
#segment's bracket match from leaking into the next segmenttimestamp_listclipping independent of text-match warning stateProblem
When an unbracketed query occurs more than once,
proc()correctly returns multiple timestamp ranges. Both clipping paths then evaluatematchinif len(ts) > 1 and match, butmatchwas only assigned inside the bracket branch. This raises:This is the repeated-text failure reproduced while answering Discussion #128.
Validation
main: 2 tests failed with the exactUnboundLocalErrorpy_compile, formatter check, andgit diff --check0.5-1.0sand2.5-3.0s1.000s重复entriesNo.1 ... 2 periodswarning in the final video message