From 3c9dd3ca622a46e0e619e44d934e3a2c635bde6c Mon Sep 17 00:00:00 2001 From: Gronod Date: Thu, 21 May 2026 00:37:37 +0100 Subject: [PATCH] Fix: Remove unmatched torrents from download display 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. --- server/services/DownloadMatcher.js | 33 ------------------------------ 1 file changed, 33 deletions(-) diff --git a/server/services/DownloadMatcher.js b/server/services/DownloadMatcher.js index 935f8aa..0e51fd3 100644 --- a/server/services/DownloadMatcher.js +++ b/server/services/DownloadMatcher.js @@ -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; }