-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(methods): add SyncMainData and GetFreeSpaceOnDisk #26
Conversation
methods.go
Outdated
|
||
defer resp.Body.Close() | ||
|
||
body, err := io.ReadAll(resp.Body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, you can fed it directly into the unmarshaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be done now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be the full MainData method instead of just the serverstate freespace field.
If you get the full JSON from qbit you can generate a struct from JSON in Goland easily by just pasting from clipboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added SyncMainData and filled the struct with the correct members.
This PR adds the ability to get the free space left on the default qbittorrent save path.
Not sure if
return 0
on L1301 and L1306 is the way to go here?Also check if should make this more generic or should add other things in this call again.Only implemented the bare minimum i needed to make this work.