Skip to content

Conversation

@romanr
Copy link
Contributor

@romanr romanr commented Dec 17, 2025

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

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.
Copilot AI review requested due to automatic review settings December 17, 2025 12:18
Copy link

Copilot AI left a 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)
Copy link

Copilot AI Dec 17, 2025

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.

Copilot uses AI. Check for mistakes.


def getCurrentVersion(self):
"""Get current Kodi version in format: Git Build Compiled"""
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
"""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.
"""

Copilot uses AI. Check for mistakes.
"""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 ''
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
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 ''

Copilot uses AI. Check for mistakes.
select = selectDialog(ADDON_NAME, tmpLST)
dialog_label = ADDON_NAME
if self.currentVersion:
dialog_label = '%s[CR]$NUMBER[%s]' % (ADDON_NAME, self.currentVersion)
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
dialog_label = '%s[CR]$NUMBER[%s]' % (ADDON_NAME, self.currentVersion)
dialog_label = '%s[CR]%s' % (ADDON_NAME, self.currentVersion)

Copilot uses AI. Check for mistakes.
else:
dialog_label = url.replace(BASE_URL,'./').replace('//','/')
if self.currentVersion:
dialog_label = '%s[CR]ver. $NUMBER[%s]' % (dialog_label, self.currentVersion)
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
dialog_label = '%s[CR]ver. $NUMBER[%s]' % (dialog_label, self.currentVersion)
dialog_label = '%s[CR]ver. [%s]' % (dialog_label, self.currentVersion)

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
from platform import system, architecture, machine, release, version
from platform import machine

Copilot uses AI. Check for mistakes.
@Lunatixz Lunatixz merged commit 342dae3 into Lunatixz:master Jan 1, 2026
6 of 7 checks passed
@Lunatixz
Copy link
Owner

Lunatixz commented Jan 1, 2026

Thanks

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