mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 13:04:23 +00:00
Clean up coding style
This commit is contained in:
parent
b2f951a269
commit
f7f0a27d76
@ -1738,15 +1738,9 @@
|
|||||||
|
|
||||||
// Share Limiting
|
// Share Limiting
|
||||||
$('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
|
$('max_ratio_checkbox').setProperty('checked', pref.max_ratio_enabled);
|
||||||
if (pref.max_ratio_enabled)
|
$('max_ratio_value').setProperty('value', (pref.max_ratio_enabled ? pref.max_ratio : 1));
|
||||||
$('max_ratio_value').setProperty('value', pref.max_ratio);
|
|
||||||
else
|
|
||||||
$('max_ratio_value').setProperty('value', 1);
|
|
||||||
$('max_seeding_time_checkbox').setProperty('checked', pref.max_seeding_time_enabled);
|
$('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_enabled ? pref.max_seeding_time.toInt() : 1440));
|
||||||
$('max_seeding_time_value').setProperty('value', pref.max_seeding_time.toInt());
|
|
||||||
else
|
|
||||||
$('max_seeding_time_value').setProperty('value', 1440);
|
|
||||||
let maxRatioAct = 0;
|
let maxRatioAct = 0;
|
||||||
switch (pref.max_ratio_act.toInt()) {
|
switch (pref.max_ratio_act.toInt()) {
|
||||||
case 0: // Pause
|
case 0: // Pause
|
||||||
@ -2108,7 +2102,7 @@
|
|||||||
let max_ratio = -1;
|
let max_ratio = -1;
|
||||||
if ($('max_ratio_checkbox').getProperty('checked')) {
|
if ($('max_ratio_checkbox').getProperty('checked')) {
|
||||||
max_ratio = $('max_ratio_value').getProperty('value');
|
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]");
|
alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2119,7 +2113,7 @@
|
|||||||
let max_seeding_time = -1;
|
let max_seeding_time = -1;
|
||||||
if ($('max_seeding_time_checkbox').getProperty('checked')) {
|
if ($('max_seeding_time_checkbox').getProperty('checked')) {
|
||||||
max_seeding_time = $('max_seeding_time_value').getProperty('value').toInt();
|
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]");
|
alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user