George-Miao / qbit

A Rust library for interacting with qBittorrent's Web API
https://docs.rs/qbit-rs
MIT License
32 stars 12 forks source link

Fix add_torrent api #16

Closed wind-mask closed 3 months ago

wind-mask commented 3 months ago

change the add_torrent method and AddTorrentArg and it's source to support torrent from file.

The add_torrent method no longer uses the generic post and request methods, but given that there is only one place in the qbittorrent api that sends raw data, such a hack is acceptable. Probably clone torrent file bytes unnecessarily. unoptimized considering the size of the torrent file.

Added the test and incidentally fixed the failure of the torrent link in the test.