mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 02:56:05 +00:00
server: migrate setTorrentsTags and setTorrentContentsPriority to clientGatewayService
This commit is contained in:
@@ -118,18 +118,6 @@ class ClientRequest {
|
||||
this.requests.push(getMethodCall('t.multicall', trackerParams));
|
||||
}
|
||||
|
||||
setFilePriority(options) {
|
||||
const indices = getEnsuredArray(options.indices);
|
||||
const hashes = getEnsuredArray(options.hashes);
|
||||
|
||||
hashes.forEach((hash) => {
|
||||
indices.forEach((index) => {
|
||||
this.requests.push(getMethodCall('f.priority.set', [`${hash}:f${index}`, options.priority]));
|
||||
});
|
||||
this.requests.push(getMethodCall('d.update_priorities', [hash]));
|
||||
});
|
||||
}
|
||||
|
||||
setSettings(options) {
|
||||
const settings = getEnsuredArray(options.settings);
|
||||
|
||||
@@ -138,26 +126,6 @@ class ClientRequest {
|
||||
});
|
||||
}
|
||||
|
||||
setTaxonomy(options) {
|
||||
const methodName = 'd.custom1.set';
|
||||
|
||||
const tags = options.tags
|
||||
.reduce((memo, currentTag) => {
|
||||
const tag = encodeURIComponent(currentTag.trim());
|
||||
|
||||
if (tag !== '' && memo.indexOf(tag) === -1) {
|
||||
memo.push(tag);
|
||||
}
|
||||
|
||||
return memo;
|
||||
}, [])
|
||||
.join(',');
|
||||
|
||||
getEnsuredArray(options.hashes).forEach((hash) => {
|
||||
this.requests.push(getMethodCall(methodName, [hash, tags]));
|
||||
});
|
||||
}
|
||||
|
||||
setTracker(options) {
|
||||
const existingTrackerIndex = 0;
|
||||
const {tracker} = options;
|
||||
|
||||
Reference in New Issue
Block a user