Add option to stop seeding when torrent has been inactive

PR #19294.
Closes #533.
Closes #8073.
Closes #15939.
This commit is contained in:
Christopher 2023-07-15 06:14:42 -04:00 committed by GitHub
parent f99a98306d
commit 35e18498d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 393 additions and 79 deletions

View file

@ -258,6 +258,8 @@ void AppController::preferencesAction()
data[u"max_ratio"_s] = session->globalMaxRatio();
data[u"max_seeding_time_enabled"_s] = (session->globalMaxSeedingMinutes() >= 0.);
data[u"max_seeding_time"_s] = session->globalMaxSeedingMinutes();
data[u"max_inactive_seeding_time_enabled"_s] = (session->globalMaxInactiveSeedingMinutes() >= 0.);
data[u"max_inactive_seeding_time"_s] = session->globalMaxInactiveSeedingMinutes();
data[u"max_ratio_act"_s] = session->maxRatioAction();
// Add trackers
data[u"add_trackers_enabled"_s] = session->isAddTrackersEnabled();
@ -739,6 +741,11 @@ void AppController::setPreferencesAction()
else
session->setGlobalMaxSeedingMinutes(-1);
}
if (hasKey(u"max_inactive_seeding_time_enabled"_s))
{
session->setGlobalMaxInactiveSeedingMinutes(it.value().toBool()
? m[u"max_inactive_seeding_time"_s].toInt() : -1);
}
if (hasKey(u"max_ratio_act"_s))
session->setMaxRatioAction(static_cast<MaxRatioAction>(it.value().toInt()));
// Add trackers