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:
commit
042b1e32e4
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue