mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 19:11:14 +00:00
Ensure the addtime parameter is set for each added torrent
Add destination only if a destination was specified
This commit is contained in:
+12
-5
@@ -28,13 +28,20 @@ client.prototype.add = function(data, callback) {
|
||||
var torrentsAdded = 0;
|
||||
|
||||
while (torrentsAdded < data.urls.length) {
|
||||
var parameters = [
|
||||
'',
|
||||
data.urls[torrentsAdded]
|
||||
];
|
||||
|
||||
if (data.destination !== null && data.destination !== '') {
|
||||
parameters.push('d.directory.set="' + data.destination + '"');
|
||||
}
|
||||
|
||||
parameters.push('d.custom.set=addtime,' + Math.floor(Date.now() / 1000));
|
||||
|
||||
multicall[0].push({
|
||||
methodName: 'load.start',
|
||||
params: [
|
||||
'',
|
||||
data.urls[torrentsAdded],
|
||||
'd.directory.set="' + data.destination + '"'
|
||||
]
|
||||
params: parameters
|
||||
});
|
||||
|
||||
torrentsAdded++;
|
||||
|
||||
Reference in New Issue
Block a user