Conversation
Review: Fix "bulk delete videos by watch progress"Clean, focused fix for a real DOM-rename regression. A few items: Selector strategy One concern: the attribute selector
Whitespace in the diff Test file: source-string assertions
The source-string assertions are the strongest part of this PR. They will fail if anyone "refactors" the selector back to a single-version lookup, even if the behavioral test happens to pass on the current YouTube DOM. Worth keeping in mind: the source-string assertion Behavioral test: The Missing newline at end of file Test sandbox: minimal globals One thing missing: the test does not assert the rendered thumbnail's progress matches what
The PR description doesn't mention it. A one-line "lockfile churn from local npm install, no functional impact" note in the description would help future archaeological reviews. Minor — not a blocker.
Otherwise: the fix is correct, the regression coverage is strong, the test design (source-string + behavioral) is exactly what is needed for a DOM-rename regression, and the PR description explains the root cause clearly. Approve once the trailing newline and the lockfile note are addressed. |
Note: the package-lock.json changes in this PR are from a local npm install / dependency refresh and aren't functionally related to this fix.
|
Targeted fix with good regression coverage, but a few things worth tightening. Logic
Robustness
Tests
Nits
Overall the fix is correct and the test suite nails the regression. The selector robustness and the redundant regex test are the only items I would push on. |
|
Tested locally:
|
Fixes Bug 2 of #4318
What
Fix the bug where setting the deletion threshold down to 5% doesn't do the job. Only if the threshold is set to 0% do the videos get deleted.
Why
Users should be able to properly bulk delete videos that match the selected threshold (E.g, watch progress >= 5% should be deleted)
How
Root cause: YouTube renamed to and removed the #progress id, so getWatchedPercentFromRenderer() always fell through to 0 for any partially-watched video, meaning only threshold=0 ever matched anything.
Note: The package-lock.json changes in this PR are from a local npm install / dependency refresh and aren't functionally related to this fix.
Testing
npx jest tests/unit/playlist-watched-progress.test.jsnpm testnpm run lint