ok here we go: want to be able to interact with the qbittorrent client and store logins, so made a tiny little wrapper around qbittorrent-api. just added a few convenience functions for now and only added a method to add a torrent to the client, but we can expand this as needed.
I also changed the way that secrets were handled, moving them into a type so that we could have multiple things that stored in the keychain without needing to babysit them, but that required a little bit of an awkward closure becuase the type is created at class instantiation time rather than field instantiation time. we can fix it later if it's broken, but it should work for now lol.
made a general skeleton so we could make adapters to multiple clients - we aren't trying to make a full-on API adapter here, just wrap what we need to for the sake of using the cli with sciop.
made it so that you can have multiple clients configured and then address them by index
so basically this should work like
$ sciop-cli client login
Which type of client? (qbittorrent): qbittorrent
Username: admin
Password:
Host: localhost
Port: 8080
Added new client configuration
{'client': 'qbittorrent', 'host': 'localhost', 'port': 8080, 'username': 'admin', 'password': SecretStr('**********')}
and then you can see your available configs by index
$ sciop-cli client list
{
0: QBittorrentConfig(client='qbittorrent', host='localhost', port=8080, username='admin', password=SecretStr('**********')),
1: QBittorrentConfig(client='qbittorrent', host='example.com/qbt', port=8080, username='admin', password=SecretStr('**********'))
}
and then all the api methods take that index as an argument.
also: for the sake of search - fixed refreshing tokens, it was just all wrong before
ok here we go: want to be able to interact with the qbittorrent client and store logins, so made a tiny little wrapper around `qbittorrent-api`. just added a few convenience functions for now and only added a method to add a torrent to the client, but we can expand this as needed.
I also changed the way that secrets were handled, moving them into a type so that we could have multiple things that stored in the keychain without needing to babysit them, but that required a little bit of an awkward closure becuase the type is created at class instantiation time rather than field instantiation time. we can fix it later if it's broken, but it should work for now lol.
made a general skeleton so we could make adapters to multiple clients - we aren't trying to make a full-on API adapter here, just wrap what we need to for the sake of using the cli with sciop.
made it so that you can have multiple clients configured and then address them by index
so basically this should work like
```shell
$ sciop-cli client login
Which type of client? (qbittorrent): qbittorrent
Username: admin
Password:
Host: localhost
Port: 8080
Added new client configuration
{'client': 'qbittorrent', 'host': 'localhost', 'port': 8080, 'username': 'admin', 'password': SecretStr('**********')}
```
and then you can see your available configs by index
```shell
$ sciop-cli client list
{
0: QBittorrentConfig(client='qbittorrent', host='localhost', port=8080, username='admin', password=SecretStr('**********')),
1: QBittorrentConfig(client='qbittorrent', host='example.com/qbt', port=8080, username='admin', password=SecretStr('**********'))
}
```
and then all the api methods take that index as an argument.
---
also: for the sake of search - fixed refreshing tokens, it was just all wrong before