-
-
Notifications
You must be signed in to change notification settings - Fork 107
Add current Kodi version display to Android package selection dialog #290
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
Conversation
Display current Kodi version info in selection dialog to help users identify their installed version when choosing packages to install. Changes: - Add getCurrentVersion() method to extract git hash, build version, and compile date from Kodi system info labels - Display version in format: "Git Build Compiled" - Update buildMain() to show version in main menu dialog - Update selectPath() to show version in package selection dialogs
Removed duplicate en_US and fa_AF entries that conflicted with en_us and fa_af on case-insensitive filesystems (macOS APFS). Keeping only the lowercase versions to prevent perpetual git status changes.
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.
Pull request overview
This PR adds current Kodi version information display to the Android package selection dialogs to help users identify their installed version. It also cleans up duplicate language files with incorrect casing in the Windows installer.
- Implements getCurrentVersion() method to extract and format Kodi version details from system info labels
- Integrates version display into main menu and package selection dialogs
- Removes duplicate language files (resource.language.en_US and resource.language.fa_AF) that have incorrect casing
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| script.kodi.android.update/default.py | Adds getCurrentVersion() method and integrates version display into buildMain() and selectPath() dialog labels |
| script.kodi.android.update/addon.xml | Bumps version from 1.3.7 to 1.3.8 |
| script.kodi.windows.update/resources/language/resource.language.en_US/strings.po | Removes duplicate language file with incorrect casing (should be en_us) |
| script.kodi.windows.update/resources/language/resource.language.fa_AF/strings.po | Removes duplicate language file with incorrect casing (should be fa_af) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| minor = BUILD.get('minor', '') | ||
| tag = BUILD.get('tag', '') | ||
| revision = BUILD.get('revision', '') | ||
| build_str = '%s.%s-%s %s (%s)' % (major, minor, tag, machine(), revision) |
Copilot
AI
Dec 17, 2025
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 format string includes machine() from the platform module, but the function may not return consistent or expected values across all Android devices. Consider whether this information is actually necessary in the version display, as it adds complexity without clear benefit mentioned in the PR description.
|
|
||
|
|
||
| def getCurrentVersion(self): | ||
| """Get current Kodi version in format: Git Build Compiled""" |
Copilot
AI
Dec 17, 2025
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 docstring states the format is "Git Build Compiled" but the actual implementation produces a much more complex format that includes major.minor-tag, machine(), revision, and build date. Update the docstring to accurately reflect the actual output format.
| """Get current Kodi version in format: Git Build Compiled""" | |
| """Return the current Kodi version string. | |
| The version string is built from up to three parts, joined by spaces: | |
| - Git hash from System.BuildVersionGit or System.BuildVersion | |
| - Build info from BUILD as: "<major>.<minor>-<tag> <machine> (<revision>)" | |
| - Build date from System.BuildDate | |
| Example combined format: | |
| "<git_hash> <major>.<minor>-<tag> <machine> (<revision>) <build_date>" | |
| One or more components may be omitted if not available. | |
| """ |
| """Get current Kodi version in format: Git Build Compiled""" | ||
| try: | ||
| # Get git hash from System.BuildVersionGit or System.BuildVersion | ||
| git_hash = xbmc.getInfoLabel('System.BuildVersionGit') or xbmc.getInfoLabel('System.BuildVersion').split('-')[0] if '-' in xbmc.getInfoLabel('System.BuildVersion') else '' |
Copilot
AI
Dec 17, 2025
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 conditional expression evaluates xbmc.getInfoLabel('System.BuildVersion') multiple times, which is inefficient and could lead to inconsistent results. The expression can also fail if System.BuildVersion returns an empty string, because split('-')[0] would be called on an empty string when the outer or evaluates to ''. Store the result in a variable first and then perform the conditional logic.
| git_hash = xbmc.getInfoLabel('System.BuildVersionGit') or xbmc.getInfoLabel('System.BuildVersion').split('-')[0] if '-' in xbmc.getInfoLabel('System.BuildVersion') else '' | |
| git_hash = xbmc.getInfoLabel('System.BuildVersionGit') | |
| if not git_hash: | |
| build_version = xbmc.getInfoLabel('System.BuildVersion') or '' | |
| git_hash = build_version.split('-')[0] if '-' in build_version else '' |
| select = selectDialog(ADDON_NAME, tmpLST) | ||
| dialog_label = ADDON_NAME | ||
| if self.currentVersion: | ||
| dialog_label = '%s[CR]$NUMBER[%s]' % (ADDON_NAME, self.currentVersion) |
Copilot
AI
Dec 17, 2025
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 string contains an invalid format token '$NUMBER'. This appears to be a typo and should likely be removed or replaced with proper formatting. The token is not a valid Kodi formatting directive.
| dialog_label = '%s[CR]$NUMBER[%s]' % (ADDON_NAME, self.currentVersion) | |
| dialog_label = '%s[CR]%s' % (ADDON_NAME, self.currentVersion) |
| else: | ||
| dialog_label = url.replace(BASE_URL,'./').replace('//','/') | ||
| if self.currentVersion: | ||
| dialog_label = '%s[CR]ver. $NUMBER[%s]' % (dialog_label, self.currentVersion) |
Copilot
AI
Dec 17, 2025
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 string contains an invalid format token '$NUMBER'. This appears to be a typo and should likely be removed or replaced with proper formatting. The token is not a valid Kodi formatting directive.
| dialog_label = '%s[CR]ver. $NUMBER[%s]' % (dialog_label, self.currentVersion) | |
| dialog_label = '%s[CR]ver. [%s]' % (dialog_label, self.currentVersion) |
| from six.moves import urllib | ||
| from kodi_six import xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs | ||
| from contextlib import contextmanager | ||
| from platform import system, architecture, machine, release, version |
Copilot
AI
Dec 17, 2025
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.
Import of 'system' is not used.
Import of 'architecture' is not used.
Import of 'release' is not used.
Import of 'version' is not used.
| from platform import system, architecture, machine, release, version | |
| from platform import machine |
|
Thanks |
Display current Kodi version info in selection dialog to help users identify their installed version when choosing packages to install.
Changes:
and compile date from Kodi system info labels