Skip to content

Commit f283bd0

Browse files
committed
fix: add get version for deluge v2
1 parent 956d4ba commit f283bd0

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ console.log(res);
7373
### See Also
7474
transmission - https://github.com/TypeCtrl/transmission
7575
qbittorrent - https://github.com/TypeCtrl/qbittorrent
76+
utorrent - https://github.com/TypeCtrl/utorrent
77+
rtorrent - https://github.com/TypeCtrl/rtorrent

Diff for: src/index.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ export class Deluge implements TorrentClient {
174174
return res.body.result;
175175
}
176176

177+
/**
178+
* returns the version ex - `2.0.3-2-201906121747-ubuntu18.04.1`
179+
*/
180+
async getVersion() {
181+
const req = await this.request<StringStatus>('daemon.get_version');
182+
return req.body;
183+
}
184+
177185
/**
178186
* used to get torrent info before adding
179187
* @param tmpPath use path returned from upload torrent looks like `'/tmp/delugeweb-DfEsgR/tmpD3rujY.torrent'`
@@ -185,10 +193,11 @@ export class Deluge implements TorrentClient {
185193

186194
/**
187195
* Lists methods
196+
* @param auth disable or enable auth connection
188197
* @returns a list of method names
189198
*/
190-
async listMethods() {
191-
const req = await this.request<ListMethods>('system.listMethods', undefined, false);
199+
async listMethods(auth = true) {
200+
const req = await this.request<ListMethods>('system.listMethods', undefined, auth);
192201
return req.body;
193202
}
194203

0 commit comments

Comments
 (0)