Fix companion playback not starting from playlist
This commit is contained in:
parent
fc5d731859
commit
e712b6309e
1 changed files with 11 additions and 12 deletions
|
@ -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,14 +115,13 @@ 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)
|
||||||
|
|
Loading…
Reference in a new issue