def get_inputstream_addon(self):
"""Checks if the inputstream addon is installed & enabled.
Returns the type of the inputstream addon used and if it's enabled,
or None if not found.
Returns
-------
:obj:`tuple` of obj:`str` and bool, or None
Inputstream addon and if it's enabled, or None
"""
is_type = 'inputstream.adaptive'
is_enabled = False
payload = {
'jsonrpc': '2.0',
'id': 1,
'method': 'Addons.GetAddonDetails',
'params': {
'addonid': is_type,
'properties': ['enabled']
}
}
response = xbmc.executeJSONRPC(json.dumps(payload))
data = json.loads(response)
if 'error' not in data.keys():
if isinstance(data.get('result'), dict):
if isinstance(data.get('result').get('addon'), dict):
is_enabled = data.get('result').get('addon').get('enabled')
return (is_type, is_enabled)
return (None, is_enabled)
评论列表
文章目录