Clean up coding style

This commit is contained in:
Chocobo1 2020-08-19 15:25:51 +08:00
parent b2f951a269
commit f7f0a27d76
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -1738,15 +1738,9 @@
// Share Limiting
$('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
if (pref.max_ratio_enabled)
$('max_ratio_value').setProperty('value', pref.max_ratio);
else
$('max_ratio_value').setProperty('value', 1);
$('max_ratio_value').setProperty('value', (pref.max_ratio_enabled ? pref.max_ratio : 1));
$('max_seeding_time_checkbox').setProperty('checked', pref.max_seeding_time_enabled);
if (pref.max_seeding_time_enabled)
$('max_seeding_time_value').setProperty('value', pref.max_seeding_time.toInt());
else
$('max_seeding_time_value').setProperty('value', 1440);
$('max_seeding_time_value').setProperty('value', (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440));
let maxRatioAct = 0;
switch (pref.max_ratio_act.toInt()) {
case 0: // Pause
@ -2108,7 +2102,7 @@
let max_ratio = -1;
if ($('max_ratio_checkbox').getProperty('checked')) {
max_ratio = $('max_ratio_value').getProperty('value');
if (isNaN(max_ratio) || max_ratio < 0 || max_ratio > 9998) {
if (isNaN(max_ratio) || (max_ratio < 0) || (max_ratio > 9998)) {
alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
return;
}
@ -2119,7 +2113,7 @@
let max_seeding_time = -1;
if ($('max_seeding_time_checkbox').getProperty('checked')) {
max_seeding_time = $('max_seeding_time_value').getProperty('value').toInt();
if (isNaN(max_seeding_time) || max_seeding_time < 0 || max_seeding_time > 525600) {
if (isNaN(max_seeding_time) || (max_seeding_time < 0) || (max_seeding_time > 525600)) {
alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
return;
}