Allow setting tags when adding torrents

This commit is contained in:
John Furrow
2017-02-04 12:13:22 -08:00
parent ce78ce64b0
commit d81040d3c5
8 changed files with 118 additions and 49 deletions
+6 -1
View File
@@ -28,6 +28,11 @@ var client = {
let path = req.body.destination;
let request = new ClientRequest();
let start = req.body.start;
let tags = req.body.tags;
if (!Array.isArray(tags)) {
tags = tags.split(',');
}
request.createDirectory({path});
request.send();
@@ -39,7 +44,7 @@ var client = {
file.originalname = encodeURIComponent(file.originalname);
let fileRequest = new ClientRequest();
fileRequest.addFiles({files: file, path, start});
fileRequest.addFiles({files: file, path, start, tags});
// Set the callback for only the last request.
if (index === files.length - 1) {