Closed jasonlyle88 closed 4 years ago
Filter inputs must be strings OR a list of other types. That's a Deluge thing I don't know why is like that.
https://github.com/deluge-torrent/deluge/blob/deluge-1.3.15/deluge/core/filtermanager.py#L128-L130
Can you try [100] and see if it works, I assume you already checked the datatype of progress
variable.
The check code can be seen here where it's shown that Deluge loops over a list of filter items.
https://github.com/deluge-torrent/deluge/blob/deluge-1.3.15/deluge/core/filtermanager.py#L171-L172
That did it. That is so weird that they require that, but it makes it work. I did {"progress": [100]}
, {"progress": [100.0]}
and {"is_seed": [True]}
, {"is_seed": [False]}
and they all worked. Thanks for the information. As this is a weird case, this may be worth throwing in the readme or on the wiki page!
I am using python 3.7 with deluge-client 1.7.1.
When trying to filter the set of returned torrents via filter_dict parameter, I get an error if I pass a non-string value. However, if I pass a string value for a field that is not a string (int, float, bool), I get no torrents returned. The best example of this is when calling
core.get_torrents_status
. If I try to pass a filter dict of{'progress': 100}
or{'progress': 100.0}
, I get the following errors:(obviously, the line stating
deluge_client.client.TypeError: argument of type 'float' is not iterable
switchesfloat
out forint
/bool
depending on what is actually passed).If I switch to
{'progress': '100'}
,{'progress': '100.0'}
,{'progress': "100"}
, or{'progress': "100.0"}
, then I get nothing back (even though I should have several torrents returned).As I mentioned
bool
as well, I tested this with theis_seed
property, and I have the same issue withbool
types as I do withint
/float
types.