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

Bugfix: Correct API version check to support major versions >13 #738

Merged
merged 2 commits into from
Oct 14, 2022

Conversation

wutschel
Copy link
Collaborator

Description

This PR fixes a problem with a version check which was not correctly handling major versions from 13 on, e.g. the check would have failed for version 13.0 to 13.6. Currently there is no JSON API 13, but the code must be future proof.

Summary for release notes

Bugfix: Correct API version check to support major versions >13

The check was not correctly handling major version from 13 on, e.g. the check would have failed for 13.0.
@wutschel
Copy link
Collaborator Author

@kambala-decapitator, found this while preparing #737. Without this fix the App will lose the support for enhanced playlist/nowplaying visualization (see #543) when the API version is increased at a later point in time. This will impact the users with iOS < 11 as soon as we migrate to Xcode 14.

@kambala-decapitator
Copy link
Collaborator

nice find! although I'd suggest to include #737 in this release to avoid ugly code at once.

@wutschel
Copy link
Collaborator Author

I thought of adding this one now, and then add #737 (with further code changes to really make use of the new method at all relevant places) after the release of 1.11. This way we reduce the amount of changes and the risk.

@kambala-decapitator
Copy link
Collaborator

This way we reduce the amount of changes and the risk.

I agree, let's do this way

@kambala-decapitator
Copy link
Collaborator

kambala-decapitator commented Oct 13, 2022

but I still think that it's better to create a dedicated helper function for this special >= 12.7 check as it's specifically about "Playlist.Insert and Playlist.Add for recordingid"

@wutschel
Copy link
Collaborator Author

wutschel commented Oct 13, 2022

[Utilities hasRecordingIdPlaylistSupport]? :)

@kambala-decapitator
Copy link
Collaborator

if there're various API checks with dedicated purpose in code, I'd rather create new utils class like KodiAPIVersion

@wutschel
Copy link
Collaborator Author

It's only temporary, will all be replaced when #737 gets in.

@kambala-decapitator
Copy link
Collaborator

yes, I understand. I mean, if there're checks that have special meaning just like in this PR, I'd rather have them named somehow instead of throwing comment in every such place. Self-documenting code :)

@wutschel
Copy link
Collaborator Author

Got it.

…laylistSupport

Avoids code duplication and speaks for itself when called.
@wutschel
Copy link
Collaborator Author

You had in mind what I just added with b97d892? If so, I could add a few more named checks.

@kambala-decapitator
Copy link
Collaborator

yes, exactly :) Although I'd call the class APIVersionCheck, as first thought about VersionCheck would probably be "app version"

@kambala-decapitator
Copy link
Collaborator

also seems that "if API version not supported, use file path" condition deserves a separate function too - a lot of copy-paste now

@wutschel
Copy link
Collaborator Author

yes, exactly :) Although I'd call the class APIVersionCheck, as first thought about VersionCheck would probably be "app version"

If we add #737 here it will check for both API version and Kodi version.

also seems that "if API version not supported, use file path" condition deserves a separate function too - a lot of copy-paste now

That's why I added the open action #740. There is more opportunity towards common code. But I still want to keep the changes for 1.11 small.

@kambala-decapitator
Copy link
Collaborator

ok, sounds good

@kambala-decapitator kambala-decapitator merged commit f746376 into xbmc:master Oct 14, 2022
@wutschel wutschel deleted the fix_version_check branch October 14, 2022 19:20
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