mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 23:18:40 +00:00
Merge branch 'master' of deluge-torrent.org:deluge
This commit is contained in:
commit
1c15df8e00
3 changed files with 17 additions and 3 deletions
|
@ -46,7 +46,7 @@ Ext.apply(Ext, {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
isObjectsEqual: function(obj1, obj2) {
|
areObjectsEqual: function(obj1, obj2) {
|
||||||
var equal = true;
|
var equal = true;
|
||||||
if (!obj1 || !obj2) return false;
|
if (!obj1 || !obj2) return false;
|
||||||
for (var i in obj1) {
|
for (var i in obj1) {
|
||||||
|
|
|
@ -284,8 +284,15 @@
|
||||||
return ids;
|
return ids;
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function(torrents) {
|
update: function(torrents, wipe) {
|
||||||
var store = this.getStore();
|
var store = this.getStore();
|
||||||
|
|
||||||
|
// Need to perform a complete reload of the torrent grid.
|
||||||
|
if (wipe) {
|
||||||
|
store.removeAll();
|
||||||
|
this.torrents = {};
|
||||||
|
}
|
||||||
|
|
||||||
var newTorrents = [];
|
var newTorrents = [];
|
||||||
|
|
||||||
// Update and add any new torrents.
|
// Update and add any new torrents.
|
||||||
|
|
|
@ -114,6 +114,9 @@ deluge.ui = {
|
||||||
|
|
||||||
update: function() {
|
update: function() {
|
||||||
var filters = deluge.sidebar.getFilterStates();
|
var filters = deluge.sidebar.getFilterStates();
|
||||||
|
this.oldFilters = this.filters;
|
||||||
|
this.filters = filters;
|
||||||
|
|
||||||
deluge.client.web.update_ui(Deluge.Keys.Grid, filters, {
|
deluge.client.web.update_ui(Deluge.Keys.Grid, filters, {
|
||||||
success: this.onUpdate,
|
success: this.onUpdate,
|
||||||
failure: this.onUpdateError,
|
failure: this.onUpdateError,
|
||||||
|
@ -170,7 +173,11 @@ deluge.ui = {
|
||||||
' (Down: ' + fspeed(data['stats'].download_rate, true) +
|
' (Down: ' + fspeed(data['stats'].download_rate, true) +
|
||||||
' Up: ' + fspeed(data['stats'].upload_rate, true) + ')';
|
' Up: ' + fspeed(data['stats'].upload_rate, true) + ')';
|
||||||
}
|
}
|
||||||
|
if (Ext.areObjectsEqual(this.filters, this.oldFilters)) {
|
||||||
deluge.torrents.update(data['torrents']);
|
deluge.torrents.update(data['torrents']);
|
||||||
|
} else {
|
||||||
|
deluge.torrents.update(data['torrents'], true);
|
||||||
|
}
|
||||||
deluge.statusbar.update(data['stats']);
|
deluge.statusbar.update(data['stats']);
|
||||||
deluge.sidebar.update(data['filters']);
|
deluge.sidebar.update(data['filters']);
|
||||||
this.errorCount = 0;
|
this.errorCount = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue