rasmuslos / AmpFin

Native Jellyfin music player for iOS & iPadOS
Other
107 stars 10 forks source link

fix: too high volume on macOS catalyst #48

Closed gnattu closed 1 month ago

gnattu commented 1 month ago

For some reason this value could be 100 which is beyond valid range, and on macOS this will cause the volume being excessively high. Overwrite it to 1.0 when detected

rasmuslos commented 1 month ago

Can you try again from the latest commit? I improved the overall volume logic

gnattu commented 1 month ago

macro #if os(iOS) will evaluate to true of Mac Catalyst for compatibility reasons. If you want to rule out all macOS you need to be explicit and use #if os(iOS) && !targetEnvironment(macCatalyst)

gnattu commented 1 month ago

Similarly, #if !os(macOS) will also evaluates to true for Mac Catalyst

rasmuslos commented 1 month ago

Similarly, #if !os(macOS) will also evaluates to true for Mac Catalyst

Its not a big problem because the API isn't available on MacOS anyways, but I updated the code, please try again

gnattu commented 1 month ago

The volume seems to be fine now, but do you want a PR to replace all #if !os(macOS) and #if os(iOS) with the explicit version to exclude mac catalyst?

rasmuslos commented 1 month ago

There is only one other place were it matters, and it is already done properly there. All other conditions are just there because the API isn't available on macOS