1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-12 07:48:04 +00:00

WebUI: Decrease frequency of updates of property panel

Now that the properties are loaded immediately when the selected torrent
or the property tab is changed, the frequency of the updates can be
reduced without affecting the user experience.

New update intervals:
 * General: 5 seconds (10 if qBT is not reachable)
 * Tracker list: 10 seconds (20 if qBT is not reachable)
 * File list: 5 seconds (10 if qBT is not reachable)
This commit is contained in:
Gabriele 2014-12-08 22:00:00 +01:00
parent ac507261f8
commit b46ecb4351
3 changed files with 9 additions and 9 deletions

View File

@ -281,7 +281,7 @@ var loadTorrentFilesData = function() {
var new_hash = myTable.getCurrentTorrentHash(); var new_hash = myTable.getCurrentTorrentHash();
if (new_hash == "") { if (new_hash == "") {
fTable.removeAllRows(); fTable.removeAllRows();
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(1500); loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
return; return;
} }
if (new_hash != current_hash) { if (new_hash != current_hash) {
@ -295,7 +295,7 @@ var loadTorrentFilesData = function() {
method: 'get', method: 'get',
onFailure: function() { onFailure: function() {
$('error_div').set('html', '_(qBittorrent client is not reachable)'); $('error_div').set('html', '_(qBittorrent client is not reachable)');
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(2000); loadTorrentFilesDataTimer = loadTorrentFilesData.delay(10000);
}, },
onSuccess: function(files) { onSuccess: function(files) {
$('error_div').set('html', ''); $('error_div').set('html', '');
@ -334,7 +334,7 @@ var loadTorrentFilesData = function() {
else { else {
fTable.removeAllRows(); fTable.removeAllRows();
} }
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(1500); loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
} }
}).send(); }).send();
} }

View File

@ -23,7 +23,7 @@ var loadTorrentData = function() {
var current_hash = myTable.getCurrentTorrentHash(); var current_hash = myTable.getCurrentTorrentHash();
if (current_hash == "") { if (current_hash == "") {
clearData(); clearData();
loadTorrentDataTimer = loadTorrentData.delay(1500); loadTorrentDataTimer = loadTorrentData.delay(5000);
return; return;
} }
// Display hash // Display hash
@ -35,7 +35,7 @@ var loadTorrentData = function() {
method: 'get', method: 'get',
onFailure: function() { onFailure: function() {
$('error_div').set('html', '_(qBittorrent client is not reachable)'); $('error_div').set('html', '_(qBittorrent client is not reachable)');
loadTorrentDataTimer = loadTorrentData.delay(2000); loadTorrentDataTimer = loadTorrentData.delay(10000);
}, },
onSuccess: function(data) { onSuccess: function(data) {
$('error_div').set('html', ''); $('error_div').set('html', '');
@ -72,7 +72,7 @@ var loadTorrentData = function() {
else { else {
clearData(); clearData();
} }
loadTorrentDataTimer = loadTorrentData.delay(1500); loadTorrentDataTimer = loadTorrentData.delay(5000);
} }
}).send(); }).send();
} }

View File

@ -61,7 +61,7 @@ var loadTrackersData = function() {
var new_hash = myTable.getCurrentTorrentHash(); var new_hash = myTable.getCurrentTorrentHash();
if (new_hash == "") { if (new_hash == "") {
tTable.removeAllRows(); tTable.removeAllRows();
loadTrackersDataTimer = loadTrackersData.delay(1500); loadTrackersDataTimer = loadTrackersData.delay(10000);
return; return;
} }
if (new_hash != current_hash) { if (new_hash != current_hash) {
@ -75,7 +75,7 @@ var loadTrackersData = function() {
method: 'get', method: 'get',
onFailure: function() { onFailure: function() {
$('error_div').set('html', '_(qBittorrent client is not reachable)'); $('error_div').set('html', '_(qBittorrent client is not reachable)');
loadTrackersDataTimer = loadTrackersData.delay(2000); loadTrackersDataTimer = loadTrackersData.delay(20000);
}, },
onSuccess: function(trackers) { onSuccess: function(trackers) {
$('error_div').set('html', ''); $('error_div').set('html', '');
@ -94,7 +94,7 @@ var loadTrackersData = function() {
else { else {
tTable.removeAllRows(); tTable.removeAllRows();
} }
loadTrackersDataTimer = loadTrackersData.delay(1500); loadTrackersDataTimer = loadTrackersData.delay(10000);
} }
}).send(); }).send();
} }