fedarovich / qbittorrent-net-client

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

SetFilePrio #3

Closed lobster2012-user closed 5 years ago

lobster2012-user commented 5 years ago

Hi. (Last doc) https://github.com/qbittorrent/qBittorrent/wiki/Web-API-Documentation#get-torrent-contents

  1. ids id | string | File ids, separated by | Not implemented

  2. Invalid implementation

Value Description
0 Do not download
1 Normal priority
6 High priority
7 Maximal priority

It is advisable to throw an exception without sending a request if the value is incorrect.

fedarovich commented 5 years ago

Hi,

Alas, the documentation was incorrect at least for qBittorrent from 4.0.0 to 4.1.4. This method really accepted a value in a range from 0 to 7 as specified in TorrentContentPriority enum.

Moreover, there was a bug in qBittorrent web interface: a newly added torrent had empty drop-downs for file priorities, because they had priority 4 by default (and it was actual Normal), but there was no corresponding priority in the drop-downs.

In qBittorrent 4.1.5 they fixed this bug. But instead of doing it in UI, they changed it in API, so that in now corresponds to the documentation. Alas, it is a breaking change for this library. I have to think, how to handle this situation. Perhaps I might check the API version, and throw an exception for qBittorrent 4.1.5 or later.

lobster2012-user commented 5 years ago

ОК, Closed.