mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix for intro
Not very pretty but this should prevent loop when enabling intros
This commit is contained in:
parent
3a2a0ac7ef
commit
1c4bf024fb
1 changed files with 17 additions and 4 deletions
|
@ -88,7 +88,19 @@ class PlaybackUtils():
|
||||||
|
|
||||||
if len(itemsToPlay) > 1:
|
if len(itemsToPlay) > 1:
|
||||||
# Let's play the playlist
|
# Let's play the playlist
|
||||||
return self.AddToPlaylist(itemsToPlay)
|
playlist = self.AddToPlaylist(itemsToPlay)
|
||||||
|
if xbmc.getCondVisibility("Window.IsActive(home)"):
|
||||||
|
# Widget workaround
|
||||||
|
return xbmc.Player().play(playlist)
|
||||||
|
else:
|
||||||
|
# Can't pass a playlist to setResolvedUrl, so return False
|
||||||
|
# Wait for Kodi to process setResolved failure, then launch playlist
|
||||||
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xbmcgui.ListItem())
|
||||||
|
xbmc.sleep(10)
|
||||||
|
# Since we clear the original Kodi playlist, this is to prevent
|
||||||
|
# info dialog - can't play next item from showing up.
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
return xbmc.Player().play(playlist)
|
||||||
|
|
||||||
playurl = PlayUtils().getPlayUrl(server, id, result)
|
playurl = PlayUtils().getPlayUrl(server, id, result)
|
||||||
|
|
||||||
|
@ -433,6 +445,7 @@ class PlaybackUtils():
|
||||||
server = WINDOW.getProperty('server%s' % username)
|
server = WINDOW.getProperty('server%s' % username)
|
||||||
|
|
||||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||||
|
playlist.clear()
|
||||||
|
|
||||||
for itemID in itemIds:
|
for itemID in itemIds:
|
||||||
|
|
||||||
|
@ -443,7 +456,7 @@ class PlaybackUtils():
|
||||||
item_data = jsonData
|
item_data = jsonData
|
||||||
self.addPlaylistItem(playlist, item_data, server, userid)
|
self.addPlaylistItem(playlist, item_data, server, userid)
|
||||||
|
|
||||||
xbmc.Player().play(playlist)
|
return playlist
|
||||||
|
|
||||||
def addPlaylistItem(self, playlist, item, server, userid):
|
def addPlaylistItem(self, playlist, item, server, userid):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue