@ctrl/deluge
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -21,3 +21,3 @@ "use strict"; | ||
this._msgId = 0; | ||
this.config = Object.assign(Object.assign({}, defaults), options); | ||
this.config = { ...defaults, ...options }; | ||
} | ||
@@ -185,7 +185,21 @@ resetSession() { | ||
const path = upload.files[0]; | ||
const options = Object.assign({ file_priorities: [], add_paused: false, compact_allocation: false, max_connections: -1, max_download_speed: -1, max_upload_slots: -1, max_upload_speed: -1, prioritize_first_last_pieces: false, | ||
const options = { | ||
file_priorities: [], | ||
add_paused: false, | ||
compact_allocation: false, | ||
max_connections: -1, | ||
max_download_speed: -1, | ||
max_upload_slots: -1, | ||
max_upload_speed: -1, | ||
prioritize_first_last_pieces: false, | ||
// not passing path by default uses default | ||
// download_location: '/root/Downloads', | ||
// move_completed_path: '/root/Downloads', | ||
pre_allocate_storage: false, move_completed: false, seed_mode: false, sequential_download: false, super_seeding: false }, config); | ||
pre_allocate_storage: false, | ||
move_completed: false, | ||
seed_mode: false, | ||
sequential_download: false, | ||
super_seeding: false, | ||
...config, | ||
}; | ||
const res = await this.request('web.add_torrents', [[{ path, options }]]); | ||
@@ -215,8 +229,21 @@ if (res.body.result[0][0] === false) { | ||
async addTorrentMagnet(magnet, config = {}) { | ||
const options = Object.assign({ file_priorities: [], add_paused: false, compact_allocation: false, max_connections: -1, max_download_speed: -1, max_upload_slots: -1, max_upload_speed: -1, prioritize_first_last_pieces: false, | ||
const options = { | ||
file_priorities: [], | ||
add_paused: false, | ||
compact_allocation: false, | ||
max_connections: -1, | ||
max_download_speed: -1, | ||
max_upload_slots: -1, | ||
max_upload_speed: -1, | ||
prioritize_first_last_pieces: false, | ||
// not passing path by default uses default | ||
// download_location: '/root/Downloads', | ||
move_completed: false, | ||
move_completed: false, | ||
// move_completed_path: '/root/Downloads', | ||
pre_allocate_storage: false, seed_mode: false, sequential_download: false, super_seeding: false }, config); | ||
pre_allocate_storage: false, | ||
seed_mode: false, | ||
sequential_download: false, | ||
super_seeding: false, | ||
...config, | ||
}; | ||
const res = await this.request('core.add_torrent_magnet', [magnet, options]); | ||
@@ -223,0 +250,0 @@ return res.body; |
{ | ||
"name": "@ctrl/deluge", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "TypeScript api wrapper for deluge using got", | ||
@@ -5,0 +5,0 @@ "author": "Scott Cooper <scttcper@gmail.com>", |
Sorry, the diff of this file is not supported yet
83561
1128