-
Notifications
You must be signed in to change notification settings - Fork 90
feat(qbt): Show free space in status bar. #377
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
base: master
Are you sure you want to change the base?
feat(qbt): Show free space in status bar. #377
Conversation
tympanix
left a comment
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.
Great addition, thanks 👍
Most clients will just show 0 for free disk space, which may be confusing.
src/views/torrents.html
Outdated
| <i class="ui orange arrow up icon"></i> | ||
| {{ totalUploadSpeed | speed }} <span ng-if="totalUploaded">({{ totalUploaded | bytes:2 }})</span> | ||
| </div> | ||
| <div class="free-disk-space"> |
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.
Might need an ng-if here for when this info is not available (which will be most clients, except qBittorrent)
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.
Ok, my first thought was to ty and add ng-if to the div, but after some trial and error I put in an ng-container around the div and put the condition on the container.
Tested with qBittorrent and Transmission. The new element was visible only in qBittorrent and was not showing in the other client.
The condition is based on client, because we save the free space in $scope and update it only if we receive info for free space again. So if it was ng-if="freeDiskSpace" and you had two servers (qBittorrent and some other) once you connect to qBit client you load that data, and when you switch to another client freeDiskSpace does not change.
Anyway, let me know if there is anything you think can be improved here.
tympanix
left a comment
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.
Thanks for the update.
I think is is important we keep the html agnostic to the client and not introduce conditions based on individual client.
What you probably should do instead is to fix the bug, that is, make sure to always update the 'diskSpaceLeft' variable to the appropriate value and set it to null or undefined when not available. Now you can reliably use this variable for an ng-if or similar.
Closes #335
I'm a frequent user of qbittorrent, so i can see how this would be useful.
The info about space left is send only on
full_updateand is contained inserver_state.free_space_on_disk.