Fix companion playback not starting from playlist

This commit is contained in:
tomkat83 2016-07-23 17:32:57 +02:00
parent fc5d731859
commit e712b6309e

View file

@ -89,7 +89,7 @@ class Playlist():
self.playlistId = self.playlist.getPlayListId() self.playlistId = self.playlist.getPlayListId()
def _addToPlaylist(self, startitem, startPlayer=False): def _addToPlaylist(self, startitem, startPlayer=False):
started = False startpos = None
with embydb.GetEmbyDB() as emby_db: with embydb.GetEmbyDB() as emby_db:
for pos, item in enumerate(self.items): for pos, item in enumerate(self.items):
kodiId = None kodiId = None
@ -115,17 +115,16 @@ class Playlist():
# Add the kodiId # Add the kodiId
if kodiId is not None: if kodiId is not None:
item['kodiId'] = str(kodiId) item['kodiId'] = str(kodiId)
if (started is False and if (startpos is None and startitem[1] == item[startitem[0]]):
startPlayer is True and startpos = pos
startitem[1] == item[startitem[0]]):
started = True if startPlayer is True and len(self.playlist) > 0:
xbmc.Player().play(self.playlist, startpos=pos) if startpos is not None:
if (started is False and xbmc.Player().play(self.playlist, startpos=startpos)
startPlayer is True and else:
len(self.playlist) > 0): self.logMsg('Never received a starting item for playlist, '
self.logMsg('Never received a starting item for playlist, ' 'starting with the first entry', 1)
'starting with the first entry', 1) xbmc.Player().play(self.playlist)
xbmc.Player().play(self.playlist)
def playAll(self, items, startitem, offset): def playAll(self, items, startitem, offset):
""" """