Skip to content

Commit 8ca0a13

Browse files
authored
Add webOS platform (#592)
1 parent 06b88d3 commit 8ca0a13

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

lib/inputstreamhelper/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def _update_widevine(self):
359359

360360
def _check_widevine(self):
361361
"""Checks that all Widevine components are installed and available."""
362-
if system_os() == 'Android': # no checks needed for Android
362+
if system_os() == 'Android' or system_os() == 'webOS': # no checks needed for Android or webOS
363363
return True
364364

365365
if not exists(widevine_config_path()):
@@ -471,6 +471,8 @@ def info_dialog(self):
471471

472472
if system_os() == 'Android':
473473
text += localize(30820) + '\n'
474+
elif system_os() == 'webOS':
475+
text += localize(30826) + '\n'
474476
else:
475477
from time import localtime, strftime
476478
if get_setting_float('last_modified', 0.0):

lib/inputstreamhelper/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
'Android': None,
2121
'Linux': 'libwidevinecdm.so',
2222
'Windows': 'widevinecdm.dll',
23-
'Darwin': 'libwidevinecdm.dylib'
23+
'Darwin': 'libwidevinecdm.dylib',
24+
'webOS': None
2425
}
2526

2627
ARCH_MAP = {
@@ -58,14 +59,16 @@
5859
'Android',
5960
'Linux',
6061
'Windows',
61-
'Darwin'
62+
'Darwin',
63+
'webOS'
6264
]
6365

6466
WIDEVINE_MINIMUM_KODI_VERSION = {
6567
'Android': '18.0',
6668
'Windows': '18.0',
6769
'Linux': '18.0',
68-
'Darwin': '18.0'
70+
'Darwin': '18.0',
71+
'webOS': '22.0'
6972
}
7073

7174
WIDEVINE_VERSIONS_URL = 'https://dl.google.com/widevine-cdm/versions.txt'

lib/inputstreamhelper/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ def system_os():
245245
from xbmc import getCondVisibility
246246
if getCondVisibility('system.platform.android'):
247247
sys_name = 'Android'
248+
elif getCondVisibility('system.platform.webos'):
249+
sys_name = 'webOS'
248250
else:
249251
from platform import system
250252
sys_name = system()

lib/inputstreamhelper/widevine/widevine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def widevinecdm_path():
9696

9797
def has_widevinecdm():
9898
"""Whether a Widevine CDM is installed on the system"""
99-
if system_os() == 'Android': # Widevine CDM is built into Android
99+
if system_os() == 'Android' or system_os() == 'webOS': # Widevine CDM is built into Android and webOS
100100
return True
101101

102102
widevinecdm = widevinecdm_path()

resources/language/resource.language.en_gb/strings.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ msgctxt "#30825"
323323
msgid "It was extracted from {image} image version [B]{version}[/B]"
324324
msgstr ""
325325

326+
msgctxt "#30826"
327+
msgid "[B]Widevine CDM[/B] is [B]built into webOS[/B]"
328+
msgstr ""
329+
326330
msgctxt "#30830"
327331
msgid "Please report issues to: [COLOR yellow]{url}[/COLOR]"
328332
msgstr ""

resources/settings.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
<setting label="30901" help="30902" type="action" action="RunScript(script.module.inputstreamhelper, info)"/>
99
<setting type="sep"/>
1010
<setting label="30903" help="30904" type="bool" id="disabled" default="false" visible="false"/>
11-
<setting label="30905" help="30906" type="slider" id="update_frequency" default="31" range="1,3,90" option="int" enable="eq(-1,false)" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
12-
<setting label="30907" help="30908" type="folder" id="temp_path" source="" option="writeable" default="special://masterprofile/addon_data/script.module.inputstreamhelper" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
13-
<setting label="30913" help="30914" type="slider" id="backups" default="4" range="0,1,20" option="int" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
14-
<setting type="sep" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
15-
<setting label="30909" help="30910" type="action" action="RunScript(script.module.inputstreamhelper, widevine_install, True)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
16-
<setting label="30911" help="30912" type="action" action="RunScript(script.module.inputstreamhelper, widevine_remove)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
17-
<setting label="30915" help="30916" type="action" action="RunScript(script.module.inputstreamhelper, rollback)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
11+
<setting label="30905" help="30906" type="slider" id="update_frequency" default="31" range="1,3,90" option="int" enable="eq(-1,false)" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
12+
<setting label="30907" help="30908" type="folder" id="temp_path" source="" option="writeable" default="special://masterprofile/addon_data/script.module.inputstreamhelper" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
13+
<setting label="30913" help="30914" type="slider" id="backups" default="4" range="0,1,20" option="int" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
14+
<setting type="sep" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
15+
<setting label="30909" help="30910" type="action" action="RunScript(script.module.inputstreamhelper, widevine_install, True)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
16+
<setting label="30911" help="30912" type="action" action="RunScript(script.module.inputstreamhelper, widevine_remove)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
17+
<setting label="30915" help="30916" type="action" action="RunScript(script.module.inputstreamhelper, rollback)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
1818
</category>
1919
<category label="30950"> <!-- Debug -->
2020
<setting label="30903" help="30904" type="bool" id="disabled" default="false"/>
2121
<setting label="30904" type="text" enable="false"/> <!-- disabled_warning -->
22-
<setting label="30955" help="30956" type="action" action="RunScript(script.module.inputstreamhelper, widevine_install_from)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | String.StartsWith(System.BuildVersion, 17)]"/>
22+
<setting label="30955" help="30956" type="action" action="RunScript(script.module.inputstreamhelper, widevine_install_from)" enable="String.StartsWith(System.BuildVersion,18) + System.HasAddon(inputstream.adaptive) | System.AddonIsEnabled(inputstream.adaptive)" visible="![System.Platform.Android | System.Platform.webOS | String.StartsWith(System.BuildVersion, 17)]"/>
2323
<setting label="30953" help="30954" type="text" id="image_url" subsetting="true" option="urlencoded" default="https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_14092.77.0_veyron-fievel_recovery_stable-channel_fievel-mp.bin.zip"/>
2424
</category>
2525
</settings>

0 commit comments

Comments
 (0)