SeedingLimits

The pure "stop seeding?" decision. This is the port of libtorrent's share-ratio and seed-time limit checks (session_impl::recalculate_auto_managed_torrents, torrent::seed_ratio / is_seed_limit_reached). Kept side-effect-free so the policy is exhaustively unit-testable; io.github.yuroyami.kitetorrent.session.engine.TorrentSession consults it on its maintenance tick and pauses when it returns true.

Properties

Link copied to clipboard
const val UNLIMITED: Int = 0

Sentinel for "no limit" in both the per-mille ratio and the seconds-valued time limit.

Functions

Link copied to clipboard
fun shouldStopSeeding(uploaded: Long, downloaded: Long, totalSize: Long, seedingSeconds: Long, ratioLimitPerMille: Int, seedTimeLimitSeconds: Int): Boolean