Fix playback startup via PMS

This commit is contained in:
tomkat83 2017-01-10 21:27:14 +01:00
parent 5c89df9110
commit 2d67bb1c1d

View file

@ -16,7 +16,7 @@ import downloadutils
from PlexAPI import API from PlexAPI import API
from PlexFunctions import GetPlexPlaylist, KODITYPE_FROM_PLEXTYPE, \ from PlexFunctions import GetPlexPlaylist, KODITYPE_FROM_PLEXTYPE, \
PLEX_TYPE_CLIP, PLEX_TYPE_MOVIE PLEX_TYPE_CLIP, PLEX_TYPE_MOVIE
from PKC_listitem import PKC_ListItem as ListItem from PKC_listitem import PKC_ListItem as ListItem, convert_PKC_to_listitem
from playlist_func import add_item_to_kodi_playlist, \ from playlist_func import add_item_to_kodi_playlist, \
get_playlist_details_from_xml, add_listitem_to_Kodi_playlist, \ get_playlist_details_from_xml, add_listitem_to_Kodi_playlist, \
add_listitem_to_playlist, remove_from_Kodi_playlist add_listitem_to_playlist, remove_from_Kodi_playlist
@ -204,11 +204,17 @@ class PlaybackUtils():
api.CreateListItemFromPlexItem(listitem) api.CreateListItemFromPlexItem(listitem)
api.set_playback_win_props(playurl, listitem) api.set_playback_win_props(playurl, listitem)
api.set_listitem_artwork(listitem) api.set_listitem_artwork(listitem)
kodiPl.add(playurl, listitem, index=self.currentPosition+1) add_listitem_to_Kodi_playlist(
playqueue,
self.currentPosition,
convert_PKC_to_listitem(listitem),
playurl,
xml_video_element=item)
else: else:
# Full metadata # Full metadata$
self.pl.insertintoPlaylist( add_item_to_kodi_playlist(
self.currentPosition+1, playqueue,
self.currentPosition,
kodi_id, kodi_id,
kodi_type) kodi_type)
self.currentPosition += 1 self.currentPosition += 1