mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 04:18:39 +00:00
(trunk web) better encapsulation of FileRow -- make most of its fields and methods private. transmission.js and remote.js don't know about FileRow anymore.
This commit is contained in:
@@ -146,18 +146,14 @@ TransmissionRemote.prototype =
|
||||
});
|
||||
},
|
||||
|
||||
changeFileCommand: function(command, rows) {
|
||||
var remote = this;
|
||||
var torrent_ids = [ rows[0].getTorrent().getId() ];
|
||||
var files = [];
|
||||
for (var i=0, row; row=rows[i]; ++i)
|
||||
files.push(row.getIndex());
|
||||
var o = {
|
||||
method: 'torrent-set',
|
||||
arguments: { ids: torrent_ids }
|
||||
};
|
||||
o.arguments[command] = files;
|
||||
this.sendRequest(o, function() {
|
||||
changeFileCommand: function(torrentId, fileIndices, command) {
|
||||
var remote = this,
|
||||
args = { ids: [torrentId] };
|
||||
args[command] = fileIndices;
|
||||
this.sendRequest({
|
||||
arguments: args,
|
||||
method: 'torrent-set'
|
||||
}, function() {
|
||||
remote._controller.refreshTorrents(torrent_ids);
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user