Open thytrherfvsefasfd443sf opened 1 year ago
Delete torrent has the same problem, and probably there are more. This is a serious problem that needs to be fixed soon. A quick solution would be just removing the validation. It seems to me that it is very unlikely that the user of this library would pass a malformed hash value, and even if he does, he would realise it when the API fails.
For DeleteAsync, there is actually an overload that accepts an IEnumerable
Alternatively, you can create a pull request for these methods and corresponding unit tests. They should look like:
public Task ResumeAsync(
IEnumerable<string> hashes,
CancellationToken token = default)
{
ValidateHashes(ref hashes);
return PostAsync(p => p.Resume(hashes), token);
}
The methods should also be added to the IQBittorrentClient2
interface.
I guess it may also be due to a recent API change on the QB side, but this library currently wrongly throws an exception if multiple hashes are passed as specified by the QB API.
https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#resume-torrents
Parameter | Type | Description -- | -- | -- hashes | string | The hashes of the torrents you want to resume. hashes can contain multiple hashes separated by \|, to resume multiple torrents, or set to all, to resume all torrents.