API: rename /file-priority API

This commit is contained in:
Jesse Chan
2020-09-30 20:29:15 +08:00
parent 2443bc9303
commit 9bcf1d8e07
4 changed files with 20 additions and 22 deletions
+3 -3
View File
@@ -227,12 +227,12 @@ class ClientRequest {
}
setFilePriority(options) {
const fileIndices = getEnsuredArray(options.fileIndices);
const indices = getEnsuredArray(options.indices);
const hashes = getEnsuredArray(options.hashes);
hashes.forEach((hash) => {
fileIndices.forEach((fileIndex) => {
this.requests.push(getMethodCall('f.priority.set', [`${hash}:f${fileIndex}`, options.priority]));
indices.forEach((index) => {
this.requests.push(getMethodCall('f.priority.set', [`${hash}:f${index}`, options.priority]));
});
this.requests.push(getMethodCall('d.update_priorities', [hash]));
});