-
Notifications
You must be signed in to change notification settings - Fork 452
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
Fix GUI downloads status update #7319
Conversation
016a1c1
to
e4b7054
Compare
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.
Looks good; I only have minor comments about naming
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.
The DLSTATUS_XXX statuses are also described in the doc/restapi/introduction.rst file, probably should be renamed here as well. Also, I see they are mentioned in comments in DownloadState.get_progress & get_status
This PR fixes #7318
The biggest part of this PR is a refactoring of
DLSTATUS
. This change introducesStatus(Enum)
which makes it possible to write stricter code and reduce duplication of the status definitions.Also, a new field was added to json response of
async def get_downloads(self, request)
to reduce unnecessary conversions from a status code to a status string and back. In simple words this change makes it possible to remove the following function:The bugfix itself is the following change (simplified):
from:
to:
The root cause of the bug is the resynchronization of a download state between the GUI and the core.