Skip to content

feat(config): support ratio randomization in stop conditions#82

Merged
takitsu21 merged 11 commits intotakitsu21:mainfrom
theguy000:feat/randomize-stop-ratio
Mar 15, 2026
Merged

feat(config): support ratio randomization in stop conditions#82
takitsu21 merged 11 commits intotakitsu21:mainfrom
theguy000:feat/randomize-stop-ratio

Conversation

@theguy000
Copy link
Copy Markdown
Contributor

  • Add randomize_ratio and random_ratio_range_percent fields to FakerConfig, InstanceConfig, and PresetSettings
  • Add UI controls (checkbox + variance slider) in StopConditionSettings and GridImportDialog
  • Compute and persist effective_stop_at_ratio across sessions and server sync
  • Add validation for random_ratio_range_percent in desktop commands

This is useful to for ban evasion in some private torrent sites.

- Add randomize_ratio and random_ratio_range_percent fields to FakerConfig, InstanceConfig, and PresetSettings
- Add UI controls (checkbox + variance slider) in StopConditionSettings and GridImportDialog
- Compute and persist effective_stop_at_ratio across sessions and server sync
- Add validation for random_ratio_range_percent in desktop commands
- Gitignore desktop-state.json
- Apply ratio randomization in RatioFaker::new when randomize_ratio is
  true, so CLI and non-UI clients benefit from it
- Update computeEffectiveRatio to return null when randomization is off
- Simplify App.svelte to pass base ratio to backend instead of
  pre-computed effective ratio
Expose the ratio randomization feature to CLI users via new flags:
- --randomize-ratio: enable stop ratio randomization
- --random-ratio-range: set the ±percentage range (default: 10%)
@takitsu21
Copy link
Copy Markdown
Owner

It seems there is an issue, in the progress bar when enabling Target ratio the progress bar reflect the Effective value but in the backend the value is random and not reflected to the UI:
image
For example here it stops at >= 0.915 according to the logs:
image

@theguy000
Copy link
Copy Markdown
Contributor Author

should be fixed. can you please test it now?

@takitsu21
Copy link
Copy Markdown
Owner

If you can fix lint/formatting issues, btw you can reproduce locally the CI before opening a PR by running ./scripts/mise ci. I think I will do a contribute markdown and how to tests / make sure everything is ok before submitting.
Thanks for all your PRs :)

@theguy000
Copy link
Copy Markdown
Contributor Author

theguy000 commented Mar 15, 2026

CI passed. my bad. you should add depandabot.

@takitsu21 takitsu21 merged commit adf8e8c into takitsu21:main Mar 15, 2026
2 checks passed
@theguy000 theguy000 deleted the feat/randomize-stop-ratio branch March 16, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants