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
@@ -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 },