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

Ensure that volume is always a Number #493

Merged
merged 1 commit into from
Sep 17, 2023

Conversation

Maxr1998
Copy link
Member

This fixes the issue where the volume is set to the maximum volume when setting a random volume by clicking the slider and then invoking the volume up action. The reason for this is that the slider apparently sets the volume to a string '100' instead of a number, and in turn the volume up concatenates the current volume with 2 instead of adding 2. As a result, the volume is set to 100 (minimum of __2 and 100) instead of the expected volume. This doesn't apply to the volume down action because string - number = number. Obviously…

Forcing the saved volume to always be a number resolves this issue. Additionally, we also don't allow setting the volume to any falsy/undefined value anymore.

This fixes the issue where the volume is set to the maximum volume when setting a random volume by clicking the slider and then invoking the volume up action.
The reason for this is that the slider apparently sets the volume to a string '100' instead of a number, and in turn the volume up concatenates the current volume with 2 instead of adding 2. As a result, the volume is set to 100 (minimum of `__2` and `100`) instead of the expected volume. This doesn't apply to the volume down action because `string - number = number`. Obviously…

Forcing the saved volume to always be a number resolves this issue. Additionally, we also don't allow setting the volume to any falsy/undefined value anymore.
@iwalton3 iwalton3 merged commit 2d138a2 into jellyfin:master Sep 17, 2023
@Maxr1998 Maxr1998 deleted the volume-up-fix branch September 17, 2023 17:39
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.

2 participants