mirror of
https://github.com/zoriya/flood.git
synced 2025-12-20 14:15:15 +00:00
Rearrange methods
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user