Skip to content

Add upload/download ratio stop condition (#65) - #68

Open
elgegeto wants to merge 3 commits into
NikolayIT:masterfrom
elgegeto:feat/issue-65-upload-download-ratio-stop
Open

elgegeto wants to merge 3 commits into
NikolayIT:masterfrom
elgegeto:feat/issue-65-upload-download-ratio-stop

Conversation

@elgegeto

Copy link
Copy Markdown

Closes #65.

Adds When upload/download ratio ≥ to the Stop dropdown. It uses the same ratio as the torrent list: reported uploaded bytes divided by reported downloaded bytes. The torrent stops and sends a stopped announce when the target is reached.

The ratio isn't available until 100 KiB has been downloaded, so the condition won't fire for a seed-only torrent or while the ratio is undefined. Non-positive thresholds are ignored.

The new enum value is appended to preserve existing saved stop-condition values. The UI labels and stop reason are included across all 38 supported languages, keeping the translation key tests in sync.

Added four engine tests and a settings serialization test for the new condition.

I couldn't run .NET 10 tests locally (SDK unavailable). CI and review are still needed; translations would also benefit from native-speaker review.

Append the stop-condition enum to keep existing persisted values stable. Reuse the current ratio calculation (available after 100 KiB downloaded) and add engine and serialization regression tests.
Keep the new stop-condition names, summaries, and stop reasons aligned with the existing translation key checks.
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.

Ratio option

1 participant