Repository navigation
WordCensor: support Subtitle Edit Batch convert - #333
Merged
Merged
Conversation
- plugin.json "batch": true - batch request: censor every line with the saved mode/replacement/red highlight, no UI; random picks seeded from the file text (reproducible) - configure request: settings-only window, settings returned without subtitle - new WordCensor.Tests project, run by word-censor.yml Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds Subtitle Edit Batch convert support (contract: SubtitleEdit/subtitleedit#16036, docs/plugin.md "Batch convert") to Word censor.
What it does
plugin.json:"batch": true.PluginBootstrap.Runbatch handler): loads the saved settings (mode, replacement text, red highlight) and censors every offensive word on all lines, the same as clicking Apply with every line checked (the window's default). No changes returnsokwithout a subtitle. Settings are not returned.okwith settings +settingsVersionand no subtitle. Cancel returnscancelled.MainWindowintoCensorSettingsso the headless batch path can use it without touching Avalonia. The settings JSON is unchanged.Decision: random modes in batch
Grawlix characters and random alternative words are random by design. The user chose these modes, so batch keeps them. To keep the run deterministic from saved settings, batch seeds the engine's
Randomfrom a stable FNV-1a hash of the file's text: converting the same file with the same settings gives the same output, and each file still gets its own picks. A normal run is unchanged and still uses an unseededRandom.Compatibility
SE 5.3 ignores
"batch"and only sendsrun. Therunpath works exactly as before.Tests
se5/WordCensor.Testsproject (modelled on FixEncodingErrors.Tests) withBatchModeTests(6 tests: grawlix on all lines, nothing to change, saved replacement + red, reproducible grawlix/alternative, settings round-trip).word-censor.ymlnow runs it in atestjob beforebuild, and its path filters include the test project.okwith no subtitle for a clean file.🤖 Generated with Claude Code