ludviglundgren / qbittorrent-cli

Cli to manage qBittorrent
MIT License
161 stars 18 forks source link

resume and remove always report success #94

Closed lingfish closed 3 days ago

lingfish commented 6 months ago

Thanks so much for this code, the import especially!

I've noticed that no matter what the hash specified (even if non-existent), it reports "successfully" resumed or removed.

qbt torrent remove --delete-files --hashes 111
(1) torrents to be removed
successfully removed (1) torrents
torrent(s) successfully deleted
qbt torrent resume --hashes zzzzzzz
torrent(s) successfully resumed
ludviglundgren commented 3 months ago

Hi! Sorry about the delay answering this!

I see how that can be confusing, but unfortunately qBittorrent does not respond back with any errors if the hash is invalid.

We could validate the hashes to be the correct length and format.

And additionally add a check to first grab the torrents from the list and iterate over it, but that feels like an unnecessary step.

The benefit would be that we would get the torrent name then so we can have better logs instead of just the hash.

Open for feedback!

lingfish commented 3 days ago

Nice one, thanks!