Fix /api/v2/torrents/info to filter by hashes query parameter
Add support for the `hashes` query parameter (pipe-separated, case-insensitive) to match real qBittorrent API behavior. This fixes compatibility with cleanuparr and *arr apps that rely on hash-based filtering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b7090eeb3a
commit
c0bbab5fa4
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();
|
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);
|
return Ok(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -604,6 +613,7 @@ public class QBAuthLoginRequest
|
||||||
public class QBTorrentsInfoRequest
|
public class QBTorrentsInfoRequest
|
||||||
{
|
{
|
||||||
public String? Category { get; set; }
|
public String? Category { get; set; }
|
||||||
|
public String? Hashes { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QBTorrentsHashRequest
|
public class QBTorrentsHashRequest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue