fedarovich / qbittorrent-net-client

qBittorrent client library for .Net
MIT License
30 stars 14 forks source link

Can I change the savePath of the torrents ? #11

Open Hendryshi opened 2 years ago

Hendryshi commented 2 years ago

Hi,

I would like to know if there exists the way to set/change the save path for the torrents using this library ? Thanks in advance

fedarovich commented 2 years ago

Hi,

Yes, sure. If you mean the default save path, then you can use something similar to:

var prefs = new Preferences { SavePath = "some path" };
await client.SetPrefencesAsync(prefs);
Hendryshi commented 2 years ago

Hi,

No I mean can I change the save path for a specific torrent ? It seems that the torrentinfo that I got from client.GetTorrentInfo is a readonly object.

Zalhera commented 2 years ago

You can change the location of a torrent by using the SetLocationAsync method and the torrent hash.

jeffward01 commented 2 years ago

You can change the location of a torrent by using the SetLocationAsync method and the torrent hash.

Very cool! So to accomplish something like this: image

NOTE: In the image, I meant to change 'Default' to YES. Pretend it says 'YES'

I would need to handle it on a 'per-torrent' basis and keep path the "Category Save Path for INCOMPLETE DOWNLOADS" saved elsewhere, then reference the saved path when adding a new torrent to CategoryXYZ?

Very cool library!

jeffward01 commented 2 years ago

You can change the location of a torrent by using the SetLocationAsync method and the torrent hash.

Hello!

I have reviewed the documentation for this, I am sorry, I can't find which object the SetLocationAsync method resides on. The documentation does not allow me to search methods, only objects.

Where can I find the SetLocationAsync method?

Thanks!


Found it! It is in the IQBittorrentClient interface.

What is the difference between:

Would we ever want to use the original (IQBittorrentClient) instead of the second version (IQBittorrentClient2)?

I see the second version is APIV2, I assume most modern QBittorrent clients use V2? Sorry for the ignorance, thanks!

Thanks

fedarovich commented 2 years ago

Hi,

Yes, you are right, for modern qbittorent versions (4.1+) you should always use IQBittorrentClient2.

IQBittorrentClient interface contains only functions available in qBittorrent 4.0.