Expose option for using basePath on torrent add

This commit is contained in:
nVitius
2017-04-25 09:41:23 -07:00
parent eb0bf0db0c
commit 133cb6389c
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -114,6 +114,7 @@ class ClientRequest {
addFiles(options) {
let files = this.getEnsuredArray(options.files);
let path = options.path;
let useBasePath = options.useBasePath;
let start = options.start;
let tagsArr = options.tags;
@@ -123,7 +124,11 @@ class ClientRequest {
let timeAdded = Math.floor(Date.now() / 1000);
if (path && path !== '') {
parameters.push(`d.directory.set="${path}"`);
if (useBasePath) {
parameters.push(`d.directory_base.set="${path}"`);
} else {
parameters.push(`d.directory.set="${path}"`);
}
}
parameters = this.addTagsToRequest(tagsArr, parameters);