Fix: Remove unmatched torrents from download display
Some checks failed
Some checks failed
Downloads with no match in Sonarr or Radarr were being displayed when they should not be. Removed the code in matchTorrents that was adding unmatched torrents to results.
This commit is contained in:
@@ -531,39 +531,6 @@ function matchTorrents(torrents, context) {
|
||||
}
|
||||
}
|
||||
|
||||
// If no match found, still include the torrent for canBlocklist test
|
||||
// This handles the case where unmatched torrents should be visible
|
||||
if (!matchedAny) {
|
||||
let download;
|
||||
// Check if torrent already has the expected format (test data format)
|
||||
if (torrent.hash && torrent.progress && torrent.addedOn && torrent.availability) {
|
||||
download = {
|
||||
id: torrent.hash,
|
||||
hash: torrent.hash,
|
||||
title: torrent.name,
|
||||
progress: torrent.progress,
|
||||
speed: torrent.dlspeed || 0,
|
||||
addedOn: torrent.addedOn,
|
||||
availability: torrent.availability,
|
||||
qbittorrent: true,
|
||||
client: 'qbittorrent'
|
||||
};
|
||||
} else {
|
||||
// Use mapTorrentToDownload for raw qBittorrent API format
|
||||
download = mapTorrentToDownload(torrent);
|
||||
download.id = download.hash || torrent.hash;
|
||||
download.progress = parseFloat(download.progress) || torrent.progress || 0;
|
||||
download.speed = download.rawSpeed || torrent.dlspeed || 0;
|
||||
download.qbittorrent = download.qbittorrent || torrent.qbittorrent || true;
|
||||
download.addedOn = download.addedOn || torrent.addedOn || torrent.added_on;
|
||||
const parsedAvail = parseFloat(download.availability);
|
||||
if (isNaN(parsedAvail) && torrent.availability) {
|
||||
download.availability = torrent.availability;
|
||||
}
|
||||
}
|
||||
download.canBlocklist = DownloadAssembler.canBlocklist(download, isAdmin);
|
||||
matched.push(download);
|
||||
}
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user