Browse Source

Fix setting preferences via WebAPI

Closes #7335.
adaptive-webui-19844
Vladimir Golovnev (Glassez) 7 years ago
parent
commit
cb505a07fe
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 20
      src/webui/api/appcontroller.cpp

20
src/webui/api/appcontroller.cpp

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

Loading…
Cancel
Save