@ctrl/qbittorrent 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/qbittorrent.js +6 -2
- package/dist/src/types.d.ts +12 -3
- package/package.json +10 -10
package/dist/src/qbittorrent.js
CHANGED
@@ -110,10 +110,10 @@ export class QBittorrent {
|
|
110
110
|
if (filter) {
|
111
111
|
params.filter = filter;
|
112
112
|
}
|
113
|
-
if (category) {
|
113
|
+
if (category !== undefined) {
|
114
114
|
params.category = category;
|
115
115
|
}
|
116
|
-
if (tag) {
|
116
|
+
if (tag !== undefined) {
|
117
117
|
params.tag = tag;
|
118
118
|
}
|
119
119
|
if (offset !== undefined) {
|
@@ -133,6 +133,7 @@ export class QBittorrent {
|
|
133
133
|
const results = {
|
134
134
|
torrents: [],
|
135
135
|
labels: [],
|
136
|
+
raw: listTorrents,
|
136
137
|
};
|
137
138
|
const labels = {};
|
138
139
|
for (const torrent of listTorrents) {
|
@@ -567,6 +568,7 @@ export class QBittorrent {
|
|
567
568
|
// allow proxy agent
|
568
569
|
...(this.config.agent ? { agent: this.config.agent } : {}),
|
569
570
|
});
|
571
|
+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
570
572
|
if (!res.headers['set-cookie'] || !res.headers['set-cookie'].length) {
|
571
573
|
throw new Error('Cookie not found. Auth Failed.');
|
572
574
|
}
|
@@ -691,6 +693,7 @@ export class QBittorrent {
|
|
691
693
|
isCompleted,
|
692
694
|
progress: torrent.progress,
|
693
695
|
label: torrent.category,
|
696
|
+
tags: torrent.tags.split(', '),
|
694
697
|
dateCompleted: new Date(torrent.completion_on * 1000).toISOString(),
|
695
698
|
savePath: torrent.save_path,
|
696
699
|
uploadSpeed: torrent.upspeed,
|
@@ -705,6 +708,7 @@ export class QBittorrent {
|
|
705
708
|
totalUploaded: torrent.uploaded,
|
706
709
|
totalDownloaded: torrent.downloaded,
|
707
710
|
ratio: torrent.ratio,
|
711
|
+
raw: torrent,
|
708
712
|
};
|
709
713
|
return result;
|
710
714
|
}
|
package/dist/src/types.d.ts
CHANGED
@@ -20,7 +20,7 @@ export interface BuildInfo {
|
|
20
20
|
*/
|
21
21
|
bitness: string;
|
22
22
|
}
|
23
|
-
export
|
23
|
+
export type TorrentFilters = 'all' | 'downloading' | 'completed' | 'paused' | 'active' | 'inactive' | 'resumed' | 'stalled' | 'stalled_uploading' | 'stalled_downloading';
|
24
24
|
export interface Torrent {
|
25
25
|
/**
|
26
26
|
* Torrent name
|
@@ -96,6 +96,7 @@ export interface Torrent {
|
|
96
96
|
* Torrent tracker
|
97
97
|
*/
|
98
98
|
tracker: string;
|
99
|
+
trackers_count: number;
|
99
100
|
/**
|
100
101
|
* Torrent download limit
|
101
102
|
*/
|
@@ -148,6 +149,10 @@ export interface Torrent {
|
|
148
149
|
* Upload seeding time limit
|
149
150
|
*/
|
150
151
|
seeding_time_limit: number;
|
152
|
+
/**
|
153
|
+
* True if super seeding is enabled
|
154
|
+
*/
|
155
|
+
super_seeding: boolean;
|
151
156
|
/**
|
152
157
|
* Indicates the time when the torrent was last seen complete/whole
|
153
158
|
*/
|
@@ -165,8 +170,12 @@ export interface Torrent {
|
|
165
170
|
* Category name
|
166
171
|
*/
|
167
172
|
category: string;
|
173
|
+
/**
|
174
|
+
* Comma-concatenated tag list of the torrent e.g. - "abc, 123"
|
175
|
+
*/
|
176
|
+
tags: string;
|
168
177
|
}
|
169
|
-
export
|
178
|
+
export type TorrentCategories = Record<string, Category>;
|
170
179
|
interface Category {
|
171
180
|
name: string;
|
172
181
|
savePath: string;
|
@@ -512,7 +521,7 @@ export declare enum TorrentPieceState {
|
|
512
521
|
*/
|
513
522
|
Downloaded = 2
|
514
523
|
}
|
515
|
-
|
524
|
+
type TrueFalseStr = 'true' | 'false';
|
516
525
|
export interface AddTorrentOptions {
|
517
526
|
/**
|
518
527
|
* not totally sure what its for but its required
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ctrl/qbittorrent",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.2.0",
|
4
4
|
"description": "TypeScript api wrapper for qbittorrent using got",
|
5
5
|
"author": "Scott Cooper <scttcper@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -28,28 +28,28 @@
|
|
28
28
|
"build:docs": "typedoc",
|
29
29
|
"test": "vitest run",
|
30
30
|
"test:watch": "vitest",
|
31
|
-
"test:ci": "vitest run --coverage --reporter=junit --outputFile=./junit.xml"
|
31
|
+
"test:ci": "vitest run --coverage --reporter=default --reporter=junit --outputFile=./junit.xml"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@ctrl/magnet-link": "^3.1.1",
|
35
|
-
"@ctrl/shared-torrent": "^4.2
|
35
|
+
"@ctrl/shared-torrent": "^4.3.2",
|
36
36
|
"@ctrl/torrent-file": "^2.0.2",
|
37
37
|
"@ctrl/url-join": "^2.0.2",
|
38
38
|
"formdata-node": "^5.0.0",
|
39
|
-
"got": "^12.3
|
39
|
+
"got": "^12.5.3",
|
40
40
|
"tough-cookie": "^4.1.2"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
|
-
"@ctrl/eslint-config": "3.
|
43
|
+
"@ctrl/eslint-config": "3.5.7",
|
44
44
|
"@sindresorhus/tsconfig": "3.0.1",
|
45
|
-
"@types/node": "18.
|
45
|
+
"@types/node": "18.11.13",
|
46
46
|
"@types/tough-cookie": "4.0.2",
|
47
|
-
"@vitest/coverage-c8": "0.
|
47
|
+
"@vitest/coverage-c8": "0.25.7",
|
48
48
|
"c8": "7.12.0",
|
49
49
|
"p-wait-for": "5.0.0",
|
50
|
-
"typedoc": "0.23.
|
51
|
-
"typescript": "4.
|
52
|
-
"vitest": "0.
|
50
|
+
"typedoc": "0.23.21",
|
51
|
+
"typescript": "4.9.4",
|
52
|
+
"vitest": "0.25.7"
|
53
53
|
},
|
54
54
|
"release": {
|
55
55
|
"branches": [
|