Fix trailers not playing

This commit is contained in:
croneter 2018-02-06 20:12:44 +01:00
parent a2c2649bc9
commit d8de492d97
2 changed files with 18 additions and 14 deletions

View file

@ -139,7 +139,9 @@ def playback_init(plex_id, plex_type, playqueue):
else:
trailers = True
LOG.info('Playing trailers: %s', trailers)
# Post to the PMS to create a playqueue - in any case due to Plex Companion
playqueue.clear()
if plex_type != v.PLEX_TYPE_CLIP:
# Post to the PMS to create a playqueue - in any case due to Companion
xml = init_plex_playqueue(plex_id,
xml.attrib.get('librarySectionUUID'),
mediatype=plex_type,
@ -151,7 +153,6 @@ def playback_init(plex_id, plex_type, playqueue):
dialog('notification', lang(29999), lang(30128), icon='{error}')
return
# Should already be empty, but just in case
playqueue.clear()
PL.get_playlist_details_from_xml(playqueue, xml)
stack = _prep_playlist_stack(xml)
# Sleep a bit to let setResolvedUrl do its thing - bit ugly

View file

@ -284,7 +284,10 @@ def playlist_item_from_xml(playlist, xml_video_element, kodi_id=None,
api = API(xml_video_element)
item.plex_id = api.getRatingKey()
item.plex_type = api.getType()
try:
item.id = xml_video_element.attrib['%sItemID' % playlist.kind]
except KeyError:
pass
item.guid = xml_video_element.attrib.get('guid')
if item.guid is not None:
item.guid = escape_html(item.guid)