Fix for Kodi 17 Krypton TypeError on playback start: 'offscreen' is an invalid keyword argument for this function

This commit is contained in:
croneter 2019-06-16 14:11:53 +02:00
parent 966d368261
commit 68cf59293f
1 changed files with 10 additions and 4 deletions

View File

@ -16,6 +16,7 @@ WINDOW = xbmcgui.Window(10000)
WINDOW_UPSTREAM = 'plexkodiconnect.result.upstream'.encode('utf-8')
WINDOW_DOWNSTREAM = 'plexkodiconnect.result.downstream'.encode('utf-8')
WINDOW_COMMAND = 'plexkodiconnect.command'.encode('utf-8')
KODIVERSION = int(xbmc.getInfoLabel("System.BuildVersion")[:2])
def cast(func, value):
@ -145,10 +146,15 @@ def convert_pkc_to_listitem(pkc_listitem):
Insert a PKCListItem() and you will receive a valid XBMC listitem
"""
data = pkc_listitem.data
listitem = xbmcgui.ListItem(label=data.get('label'),
label2=data.get('label2'),
path=data.get('path'),
offscreen=True)
if KODIVERSION >= 18:
listitem = xbmcgui.ListItem(label=data.get('label'),
label2=data.get('label2'),
path=data.get('path'),
offscreen=True)
else:
listitem = xbmcgui.ListItem(label=data.get('label'),
label2=data.get('label2'),
path=data.get('path'))
if data['info']:
listitem.setInfo(**data['info'])
for stream in data['stream_info']: