Merge pull request #946 from jfrconley/fix/torrents-info-hashes-filter

Fix /api/v2/torrents/info to filter by hashes query parameter
This commit is contained in:
Roger Far 2026-03-14 13:27:13 -06:00 committed by GitHub
commit 042b1e32e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,6 +164,15 @@ public class QBittorrentController(ILogger<QBittorrentController> logger, QBitto
results = results.Where(m => m.Category == request.Category).ToList();
}
if (!String.IsNullOrWhiteSpace(request.Hashes))
{
var hashSet = new HashSet<String>(
request.Hashes.Split('|', StringSplitOptions.RemoveEmptyEntries),
StringComparer.OrdinalIgnoreCase
);
results = results.Where(m => hashSet.Contains(m.Hash)).ToList();
}
return Ok(results);
}
@ -604,6 +613,7 @@ public class QBAuthLoginRequest
public class QBTorrentsInfoRequest
{
public String? Category { get; set; }
public String? Hashes { get; set; }
}
public class QBTorrentsHashRequest