fix(qbittorrent): sort torrents by progress so active items appear before limit cutoff (#6297)

This commit is contained in:
Thomas authored and GitHub committed 2026-07-12 14:56:24 +02:00
1 parent 807e5eb2a9
commit 03f68a0421
1 file changed
+1 -1
@@ -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 },