Fix ratio handling

PR #22638.
This commit is contained in:
Vladimir Golovnev 2025-05-01 14:18:18 +03:00 committed by GitHub
commit 6cd6267c26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 16 additions and 21 deletions

View file

@ -1242,7 +1242,7 @@ qreal SessionImpl::globalMaxRatio() const
void SessionImpl::setGlobalMaxRatio(qreal ratio)
{
if (ratio < 0)
ratio = -1.;
ratio = Torrent::NO_RATIO_LIMIT;
if (ratio != globalMaxRatio())
{
@ -2331,7 +2331,7 @@ void SessionImpl::processTorrentShareLimits(TorrentImpl *torrent)
QString description;
if (const qreal ratio = torrent->realRatio();
(ratioLimit >= 0) && (ratio <= Torrent::MAX_RATIO) && (ratio >= ratioLimit))
(ratioLimit >= 0) && (ratio >= ratioLimit))
{
reached = true;
description = tr("Torrent reached the share ratio limit.");