Skip to content

Commit

Permalink
fix: add total_size to torrent details
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Apr 10, 2019
1 parent b72ff8e commit 6540646
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ module.exports = {
'no-await-in-loop': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/promise-function-async': 0,
'@typescript-eslint/unified-signatures': 0,
},
};
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ export class Deluge implements TorrentClient {
'total_payload_upload',
'next_announce',
'tracker_status',
'tracker',
'comment',
'num_pieces',
'piece_length',
'is_auto_managed',
Expand All @@ -361,6 +363,8 @@ export class Deluge implements TorrentClient {
'time_added',
'tracker_host',
'save_path',
'total_size',
'num_files',
'total_done',
'total_uploaded',
'max_download_speed',
Expand Down Expand Up @@ -542,6 +546,7 @@ export class Deluge implements TorrentClient {
totalPeers: torrent.total_peers,
totalSeeds: torrent.total_seeds,
totalSelected: torrent.total_wanted,
totalSize: torrent.total_size,
totalUploaded: torrent.total_uploaded,
totalDownloaded: torrent.total_done,
};
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ export interface Torrent {
max_upload_speed: number;
eta: number;
save_path: string;
comment: string;
num_files: number;
total_size: number;
progress: number;
time_added: number;
tracker_host: string;
tracker: string;
total_uploaded: number;
total_done: number;
total_wanted: number;
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('Deluge', () => {
});
it('should logout', async () => {
const deluge = new Deluge({ baseUrl });
await deluge.logout();
await deluge.login();
const success = await deluge.logout();
expect(success).toBe(true);
});
Expand Down

0 comments on commit 6540646

Please sign in to comment.