fix setting the download priority for files in the files tab
This commit is contained in:
parent
668683f369
commit
91a471e781
|
@ -129,26 +129,22 @@ Copyright:
|
||||||
default:
|
default:
|
||||||
var indexes = {};
|
var indexes = {};
|
||||||
function walk(node) {
|
function walk(node) {
|
||||||
if (!node.attributes.fileIndex) return;
|
if (Ext.isEmpty(node.attributes.fileIndex)) return;
|
||||||
indexes[node.attributes.fileIndex] = node.attributes.priority;
|
indexes[node.attributes.fileIndex] = node.attributes.priority;
|
||||||
}
|
}
|
||||||
this.getRootNode().cascade(walk);
|
this.getRootNode().cascade(walk);
|
||||||
|
|
||||||
var nodes = this.getSelectionModel().getSelectedNodes();
|
var nodes = this.getSelectionModel().getSelectedNodes();
|
||||||
Ext.each(nodes, function(node) {
|
Ext.each(nodes, function(node) {
|
||||||
if (!node.attributes.fileIndex) return;
|
if (Ext.isEmpty(node.attributes.fileIndex)) return;
|
||||||
indexes[node.attributes.fileIndex] = baseItem.filePriority;
|
indexes[node.attributes.fileIndex] = baseItem.filePriority;
|
||||||
});
|
});
|
||||||
|
|
||||||
alert(Ext.keys(indexes));
|
var priorities = new Array(Ext.keys(indexes).length);
|
||||||
|
|
||||||
priorities = new Array(Ext.keys(indexes).length);
|
|
||||||
for (var index in indexes) {
|
for (var index in indexes) {
|
||||||
priorities[index] = indexes[index];
|
priorities[index] = indexes[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
alert(this.torrentId);
|
|
||||||
alert(priorities);
|
|
||||||
Deluge.Client.core.set_torrent_file_priorities(this.torrentId, priorities, {
|
Deluge.Client.core.set_torrent_file_priorities(this.torrentId, priorities, {
|
||||||
success: function() {
|
success: function() {
|
||||||
Ext.each(nodes, function(node) {
|
Ext.each(nodes, function(node) {
|
||||||
|
|
Loading…
Reference in New Issue