Skip to content
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

Downloading soundpacks sometimes doesn't show known total file size #81

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

langp11
Copy link

@langp11 langp11 commented Jan 24, 2023

Fixes remyroy#660

The current downloading progress reporting relies on Qt's downloadProgress signal https://doc.qt.io/qt-5/qnetworkreply.html#downloadProgress which includes a bytesTotal value that is assumed to be the total number of bytes expected. Kind of what you would expect.
Except or the bit that says 'If the number of bytes to be downloaded is not known, bytesTotal will be -1', which is happening in some cases, overriding the known size from soundpacks.json.

This fix remembers any defined size for the selected soundpack and uses that in the statusbar if we get a bytesTotal == -1.

Testing: Download soundpacks where
(a) there was a defined size:
launcher-downloadsoundpack1

(b) there was no defined size:
launcher-downloadsoundpack2
In this case the downloadProgress signal did know what size to expect.

Note:
This is a largely cosmetic issue, so no hurry to release.

Copy link
Owner

@DazedNConfused- DazedNConfused- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch for yet another bugfix! 🏅

@DazedNConfused- DazedNConfused- changed the base branch from master to develop January 24, 2023 14:09
@DazedNConfused- DazedNConfused- dismissed their stale review January 24, 2023 14:09

The base branch was changed.

@DazedNConfused- DazedNConfused- merged commit 3dafde1 into DazedNConfused-:develop Jan 24, 2023
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.

Downloading Soundpacks shows "X out of -1.0B"
2 participants