From e6cf159162360f922c0ad28291c57a152f16f48e Mon Sep 17 00:00:00 2001 From: John Furrow Date: Sat, 27 Feb 2016 00:14:36 -0800 Subject: [PATCH] Rearrange methods --- server/models/ClientRequest.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/server/models/ClientRequest.js b/server/models/ClientRequest.js index e82897ec..f115f6e2 100644 --- a/server/models/ClientRequest.js +++ b/server/models/ClientRequest.js @@ -78,9 +78,8 @@ class ClientRequest { .catch(this.handleError.bind(this)); } - // rTorrent method calls. // TODO: Separate these and add support for additional clients. - + // rTorrent method calls. addFilesMethodCall(options) { let files = this.getEnsuredArray(options.files); @@ -133,6 +132,16 @@ class ClientRequest { 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) { let args = this.getEnsuredArray(options.args); this.requests.push(this.getMethodCall(options.method, [args])); @@ -198,16 +207,6 @@ class ClientRequest { 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;