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
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:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user