From 1e162381f421f1102addf2e8115d4bbe8d6577e6 Mon Sep 17 00:00:00 2001 From: Gronod Date: Wed, 20 May 2026 20:45:26 +0100 Subject: [PATCH] fix: QBittorrent fallback state corruption after full sync --- server/clients/QBittorrentClient.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/clients/QBittorrentClient.js b/server/clients/QBittorrentClient.js index 22c9eeb..7fdf876 100644 --- a/server/clients/QBittorrentClient.js +++ b/server/clients/QBittorrentClient.js @@ -159,6 +159,11 @@ class QBittorrentClient extends DownloadClient { if (this.fallbackThisCycle) { logToFile(`[qBittorrent:${this.name}] Already fell back this cycle, using legacy`); const torrents = await this.getTorrentsLegacy(); + this.torrentMap = new Map(); + for (const torrent of torrents) { + this.torrentMap.set(torrent.hash, torrent); + } + this.lastRid = 0; return torrents.map(torrent => this.normalizeDownload(torrent)); } @@ -170,6 +175,11 @@ class QBittorrentClient extends DownloadClient { this.fallbackThisCycle = true; try { const torrents = await this.getTorrentsLegacy(); + this.torrentMap = new Map(); + for (const torrent of torrents) { + this.torrentMap.set(torrent.hash, torrent); + } + this.lastRid = 0; return torrents.map(torrent => this.normalizeDownload(torrent)); } catch (fallbackError) { logToFile(`[qBittorrent:${this.name}] Fallback also failed: ${fallbackError.message}`);