1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 12:34:19 +00:00

Fix setting preferences via WebAPI

Closes #7335.
This commit is contained in:
Vladimir Golovnev (Glassez) 2018-04-09 18:51:39 +03:00
parent c3311e83a0
commit cb505a07fe
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7

View File

@ -409,14 +409,18 @@ void AppController::setPreferencesAction()
if (m.contains("dont_count_slow_torrents"))
session->setIgnoreSlowTorrentsForQueueing(m["dont_count_slow_torrents"].toBool());
// Share Ratio Limiting
if (m.contains("max_ratio_enabled"))
session->setGlobalMaxRatio(m["max_ratio"].toReal());
else
session->setGlobalMaxRatio(-1);
if (m.contains("max_seeding_time_enabled"))
session->setGlobalMaxSeedingMinutes(m["max_seeding_time"].toInt());
else
session->setGlobalMaxSeedingMinutes(-1);
if (m.contains("max_ratio_enabled")) {
if (m["max_ratio_enabled"].toBool())
session->setGlobalMaxRatio(m["max_ratio"].toReal());
else
session->setGlobalMaxRatio(-1);
}
if (m.contains("max_seeding_time_enabled")) {
if (m["max_seeding_time_enabled"].toBool())
session->setGlobalMaxSeedingMinutes(m["max_seeding_time"].toInt());
else
session->setGlobalMaxSeedingMinutes(-1);
}
if (m.contains("max_ratio_act"))
session->setMaxRatioAction(static_cast<MaxRatioAction>(m["max_ratio_act"].toInt()));
// Add trackers