Compare commits

..
Author SHA1 Message Date
ajnart 09260063ae fix(qbittorrent): sort torrents by progress so active items appear before limit cutoff
The qBittorrent integration was passing only { limit } to listTorrents(),
which returns completed torrents first by default. With a 50-item limit and
large completed torrent libraries, active/incomplete torrents never appeared
in the response. The widget's client-side showCompletedTorrent filter then
had nothing to display.

Adding sort: 'progress' (ascending) ensures incomplete/active torrents always
appear first, even with a low limit.

Closes report: https://www.answeroverflow.com/m/1525039765940863046
2026-07-11 20:02:29 +02:00
4 changed files with 1 additions and 22 deletions

No files matched your search

@@ -295,13 +295,6 @@
"when": 1780764500000,
"tag": "0041_merge_custom_widget_url",
"breakpoints": true
},
{
"idx": 42,
"version": "5",
"when": 1783176100870,
"tag": "0042_add_widget_secret",
"breakpoints": true
}
]
}
@@ -57,13 +57,6 @@
"when": 1780764500000,
"tag": "0007_merge_custom_widget_url",
"breakpoints": true
},
{
"idx": 8,
"version": "7",
"when": 1783176100870,
"tag": "0008_add_widget_secret",
"breakpoints": true
}
]
}
@@ -281,13 +281,6 @@
"when": 1780764500000,
"tag": "0039_merge_custom_widget_url",
"breakpoints": true
},
{
"idx": 40,
"version": "6",
"when": 1783176100870,
"tag": "0040_add_widget_secret",
"breakpoints": true
}
]
}
@@ -30,7 +30,7 @@ export class QBitTorrentIntegration extends Integration implements IDownloadClie
public async getClientJobsAndStatusAsync(input: { limit: number }): Promise<DownloadClientJobsAndStatus> {
const type = "torrent";
const client = await this.getClientAsync();
const torrents = await client.listTorrents({ limit: input.limit });
const torrents = await client.listTorrents({ limit: input.limit, sort: "progress", reverse: false });
const rates = torrents.reduce(
({ down, up }, { dlspeed, upspeed }) => ({ down: down + dlspeed, up: up + upspeed }),
{ down: 0, up: 0 },