You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a dumb question, but I saw that you went to the trouble of defining a TorrentState type and constants for each of the possible torrent states, so I tried to do an == comparison but couldn't because TorrentStatus.State is a string and the state constants are type TorrentState. Shouldn't TorrentStatus.State be type TorrentState?
// this should work but doesn'ttors, _:=d.client.TorrentsStatus(delugeclient.StateUnspecified, nil)
iftors[0].State==delugeclient.StateSeeding {
// seeding!
}
This works if I cast the TorrentState constant to a string ( string(delugeclient.StateSeeding) ) or cast the torrent state from string to TorrentState ( delugeclient.TorrentState(tors[0].State) ) but it seems like they should already be the same type.
The text was updated successfully, but these errors were encountered:
No, it is not a dumb question - I think it does not have the right type because of the "conversion magic" that happens when decoding the python RPC data.
I am not sure how to easily fix this at the moment 🤔
This may be a dumb question, but I saw that you went to the trouble of defining a TorrentState type and constants for each of the possible torrent states, so I tried to do an == comparison but couldn't because TorrentStatus.State is a string and the state constants are type TorrentState. Shouldn't TorrentStatus.State be type TorrentState?
This works if I cast the TorrentState constant to a string (
string(delugeclient.StateSeeding)
) or cast the torrent state from string to TorrentState (delugeclient.TorrentState(tors[0].State)
) but it seems like they should already be the same type.The text was updated successfully, but these errors were encountered: