Rearrange methods

This commit is contained in:
John Furrow
2016-02-27 00:14:36 -08:00
parent b6397a5f3c
commit e6cf159162

View File

@@ -78,9 +78,8 @@ class ClientRequest {
.catch(this.handleError.bind(this)); .catch(this.handleError.bind(this));
} }
// rTorrent method calls.
// TODO: Separate these and add support for additional clients. // TODO: Separate these and add support for additional clients.
// rTorrent method calls.
addFilesMethodCall(options) { addFilesMethodCall(options) {
let files = this.getEnsuredArray(options.files); let files = this.getEnsuredArray(options.files);
@@ -133,6 +132,16 @@ class ClientRequest {
this.requests.push(this.getMethodCall('t.multicall', trackerParams)); this.requests.push(this.getMethodCall('t.multicall', trackerParams));
} }
getTorrentListMethodCall(options) {
this.requests.push(this.getMethodCall('d.multicall2', options.props));
}
getTransferDataMethodCall(options) {
Object.keys(rTorrentPropMap.transferData).forEach((key) => {
this.requests.push(this.getMethodCall(rTorrentPropMap.transferData[key]));
});
}
listMethodsMethodCall(options) { listMethodsMethodCall(options) {
let args = this.getEnsuredArray(options.args); let args = this.getEnsuredArray(options.args);
this.requests.push(this.getMethodCall(options.method, [args])); this.requests.push(this.getMethodCall(options.method, [args]));
@@ -198,16 +207,6 @@ class ClientRequest {
this.requests.push(this.getMethodCall('d.close', [hash])); this.requests.push(this.getMethodCall('d.close', [hash]));
}); });
} }
getTransferDataMethodCall(options) {
Object.keys(rTorrentPropMap.transferData).forEach((key) => {
this.requests.push(this.getMethodCall(rTorrentPropMap.transferData[key]));
});
}
getTorrentListMethodCall(options) {
this.requests.push(this.getMethodCall('d.multicall2', options.props));
}
} }
module.exports = ClientRequest; module.exports = ClientRequest;