Skip to content

Conversation

@userwiths
Copy link
Contributor

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_update and is contained in server_state.free_space_on_disk.

Copy link
Owner

@tympanix tympanix left a 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.

<i class="ui orange arrow up icon"></i>
{{ totalUploadSpeed | speed }} <span ng-if="totalUploaded">({{ totalUploaded | bytes:2 }})</span>
</div>
<div class="free-disk-space">
Copy link
Owner

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)

Copy link
Contributor Author

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.

@userwiths userwiths requested a review from tympanix June 13, 2025 18:18
Copy link
Owner

@tympanix tympanix left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Remaining free space

2 participants