|
6 | 6 | import os |
7 | 7 | from inputstreamhelper import config |
8 | 8 | from .kodiutils import (addon_profile, addon_version, browsesingle, get_proxies, get_setting, get_setting_bool, |
9 | | - get_setting_float, get_setting_int, jsonrpc, kodi_to_ascii, localize, log, notification, |
| 9 | + get_setting_float, get_setting_int, jsonrpc, kodi_to_ascii, kodi_version, localize, log, notification, |
10 | 10 | ok_dialog, progress_dialog, select_dialog, set_setting, set_setting_bool, textviewer, |
11 | 11 | translate_path, yesno_dialog) |
12 | 12 |
|
@@ -157,13 +157,6 @@ def _widevine_path(cls): |
157 | 157 |
|
158 | 158 | return False |
159 | 159 |
|
160 | | - @classmethod |
161 | | - def _kodi_version(cls): |
162 | | - """Return the current Kodi version""" |
163 | | - from xbmc import getInfoLabel |
164 | | - version = getInfoLabel('System.BuildVersion') |
165 | | - return version.split(' ')[0] |
166 | | - |
167 | 160 | @classmethod |
168 | 161 | def _arch(cls): |
169 | 162 | """Map together and return the system architecture.""" |
@@ -485,8 +478,8 @@ def _supports_widevine(self): |
485 | 478 | return False |
486 | 479 |
|
487 | 480 | from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module,useless-suppression |
488 | | - if LooseVersion(config.WIDEVINE_MINIMUM_KODI_VERSION[system_os()]) > LooseVersion(self._kodi_version()): |
489 | | - log('Unsupported Kodi version for Widevine: {version}', version=self._kodi_version()) |
| 481 | + if LooseVersion(config.WIDEVINE_MINIMUM_KODI_VERSION[system_os()]) > LooseVersion(kodi_version()): |
| 482 | + log('Unsupported Kodi version for Widevine: {version}', version=kodi_version()) |
490 | 483 | ok_dialog(localize(30004), localize(30010, version=config.WIDEVINE_MINIMUM_KODI_VERSION[system_os()])) # Kodi too old |
491 | 484 | return False |
492 | 485 |
|
@@ -1062,7 +1055,7 @@ def check_inputstream(self): |
1062 | 1055 | def info_dialog(self): |
1063 | 1056 | """ Show an Info box with useful info e.g. for bug reports""" |
1064 | 1057 | text = localize(30800) + '\n' # Kodi information |
1065 | | - text += ' - ' + localize(30801, version=self._kodi_version()) + '\n' |
| 1058 | + text += ' - ' + localize(30801, version=kodi_version()) + '\n' |
1066 | 1059 | text += ' - ' + localize(30802, platform=system_os(), arch=self._arch()) + '\n' |
1067 | 1060 | text += '\n' |
1068 | 1061 |
|
|
0 commit comments