fix: QBittorrent fallback state corruption after full sync
Licence Check / Licence compatibility and copyright header verification (push) Successful in 54s
CI / Security audit (push) Successful in 1m37s
CI / Tests & coverage (push) Failing after 1m46s
Licence Check / Licence compatibility and copyright header verification (pull_request) Successful in 1m1s
CI / Security audit (pull_request) Successful in 1m29s
CI / Tests & coverage (pull_request) Failing after 1m32s

This commit is contained in:
2026-05-20 20:45:26 +01:00
parent 1f10414498
commit 1e162381f4
+10
View File
@@ -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}`);