Skip to content

Commit e29200f

Browse files
Fix webOS (#631)
1 parent 8409f80 commit e29200f

File tree

5 files changed

+68
-12
lines changed

5 files changed

+68
-12
lines changed

lib/inputstreamhelper/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
'Windows': '18.0',
6969
'Linux': '18.0',
7070
'Darwin': '18.0',
71-
'webOS': '22.0'
71+
'webOS': '21.0'
7272
}
7373

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

lib/inputstreamhelper/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ def system_os():
267267
return getattr(system_os, 'cached')
268268

269269
from xbmc import getCondVisibility
270-
if getCondVisibility('system.platform.android'):
270+
if getCondVisibility('System.Platform.Android'):
271271
sys_name = 'Android'
272-
elif getCondVisibility('system.platform.webos'):
272+
elif getCondVisibility('System.Platform.WebOS'):
273273
sys_name = 'webOS'
274274
else:
275275
from platform import system

resources/settings.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<condition operator="is" setting="disabled">false</condition>
7878
</dependency>
7979
<dependency type="visible">
80-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
80+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
8181
</dependency>
8282
</dependencies>
8383
<control type="slider" format="integer">
@@ -94,7 +94,7 @@
9494
</constraints>
9595
<dependencies>
9696
<dependency type="visible">
97-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
97+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
9898
</dependency>
9999
</dependencies>
100100
<control type="button" format="path">
@@ -111,7 +111,7 @@
111111
</constraints>
112112
<dependencies>
113113
<dependency type="visible">
114-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
114+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
115115
</dependency>
116116
</dependencies>
117117
<control type="slider" format="integer">
@@ -134,7 +134,7 @@
134134
</and>
135135
</dependency>
136136
<dependency type="visible">
137-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
137+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
138138
</dependency>
139139
</dependencies>
140140
<control type="button" format="action"/>
@@ -153,7 +153,7 @@
153153
</and>
154154
</dependency>
155155
<dependency type="visible">
156-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
156+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
157157
</dependency>
158158
</dependencies>
159159
<control type="button" format="action"/>
@@ -172,7 +172,7 @@
172172
</and>
173173
</dependency>
174174
<dependency type="visible">
175-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
175+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
176176
</dependency>
177177
</dependencies>
178178
<control type="button" format="action"/>
@@ -215,7 +215,7 @@
215215
</and>
216216
</dependency>
217217
<dependency type="visible">
218-
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.webOS|String.StartsWith(System.BuildVersion,17)]</condition>
218+
<condition on="property" name="InfoBool">![System.Platform.Android|System.Platform.WebOS]</condition>
219219
</dependency>
220220
</dependencies>
221221
<control type="button" format="action"/>

tests/test_ishelper_webos_arm.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3+
4+
# pylint: disable=missing-docstring
5+
6+
import unittest
7+
import platform
8+
9+
import inputstreamhelper
10+
from test_utils import delete_cached, cleanup
11+
12+
xbmc = __import__('xbmc')
13+
xbmcaddon = __import__('xbmcaddon')
14+
xbmcgui = __import__('xbmcgui')
15+
xbmcvfs = __import__('xbmcvfs')
16+
17+
18+
class WebOSARMTests(unittest.TestCase):
19+
20+
def setUp(self):
21+
delete_cached()
22+
cleanup()
23+
inputstreamhelper.system_os = lambda: 'webOS'
24+
inputstreamhelper.widevine.widevine.system_os = lambda: 'webOS'
25+
inputstreamhelper.widevine.repo.system_os = lambda: 'webOS'
26+
27+
def test_check_inputstream_mpd(self):
28+
platform.machine = lambda: 'arm'
29+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
30+
is_helper.remove_widevine()
31+
is_installed = is_helper.check_inputstream()
32+
self.assertTrue(is_installed, True)
33+
34+
def test_check_inputstream_hls_again(self):
35+
platform.machine = lambda: 'armv7'
36+
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
37+
is_installed = is_helper.check_inputstream()
38+
self.assertTrue(is_installed, True)
39+
40+
def test_check_inputstream_rtmp(self):
41+
platform.machine = lambda: 'armv8'
42+
is_helper = inputstreamhelper.Helper('rtmp')
43+
is_installed = is_helper.check_inputstream()
44+
self.assertTrue(is_installed, True)
45+
46+
def test_check_inputstream_disabled(self):
47+
platform.machine = lambda: 'arm'
48+
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
49+
is_helper.disable()
50+
is_installed = is_helper.check_inputstream()
51+
is_helper.enable()
52+
self.assertTrue(is_installed, True)
53+
54+
55+
if __name__ == '__main__':
56+
unittest.main()

tests/xbmc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
INFO_LABELS = {
2525
'Container.FolderPath': 'plugin://' + ADDON_ID + '/',
26-
'System.BuildVersion': '18.9',
26+
'System.BuildVersion': '21.0',
2727
'System.OSVersionInfo': 'Linux (kernel: Linux 5.4.0-73-generic)',
2828
}
2929

@@ -228,7 +228,7 @@ def executeJSONRPC(jsonrpccommand):
228228

229229
def getCondVisibility(string):
230230
"""A reimplementation of the xbmc getCondVisibility() function"""
231-
if string in ('system.platform.android', 'system.platform.webos'):
231+
if string in ('System.Platform.Android', 'System.Platform.WebOS'):
232232
return False
233233
if string.startswith('System.HasAddon'):
234234
return True

0 commit comments

Comments
 (0)