fedarovich / qbittorrent-net-client

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

How does this work? #4

Closed devonuto closed 5 years ago

devonuto commented 5 years ago

I'm switching from using uTorrent, just trying to get thhis working, but it's not all that clear.

How do you just get a list of the current torrents, so I can process each one? I thought this would work:

using (var qBitClient = new QBittorrentClient(new Uri("http://192.168.1.2:8080/"), ApiLevel.V2))
{
    await qBitClient.LoginAsync("username", "password");
    var torrents = qBitClient.GetTorrentListAsync();                
    qBitClient.Dispose();
}

But torrents is just populated with this:

Id = 47, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}" AsyncState: null CancellationPending: false CreationOptions: None Exception: null Id: 47 Result: null Status: WaitingForActivation

I have no idea what that means?

devonuto commented 5 years ago

Ignore me, added .Result to the end of GetTorrentListAsync() and it worked