mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-13 21:56:11 +00:00
Fix intros
This commit is contained in:
parent
3f111f554e
commit
2341854de8
2 changed files with 20 additions and 6 deletions
|
@ -52,6 +52,16 @@ class PlaybackUtils(object):
|
||||||
else:
|
else:
|
||||||
self.playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
self.playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||||
|
|
||||||
|
def _detect_widgets(self):
|
||||||
|
|
||||||
|
if (not xbmc.getCondVisibility('Window.IsMedia') and
|
||||||
|
((self.item['Type'] == "Audio" and not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(music),1)')) or
|
||||||
|
not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(video),1)'))):
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def play(self, item_id, dbid=None, force_transcode=False):
|
def play(self, item_id, dbid=None, force_transcode=False):
|
||||||
|
|
||||||
listitem = xbmcgui.ListItem()
|
listitem = xbmcgui.ListItem()
|
||||||
|
@ -98,9 +108,7 @@ class PlaybackUtils(object):
|
||||||
# Stack: [(url, listitem), (url, ...), ...]
|
# Stack: [(url, listitem), (url, ...), ...]
|
||||||
self.stack[0][1].setPath(self.stack[0][0])
|
self.stack[0][1].setPath(self.stack[0][0])
|
||||||
try:
|
try:
|
||||||
if (not xbmc.getCondVisibility('Window.IsMedia') and
|
if self._detect_widgets():
|
||||||
((self.item['Type'] == "Audio" and not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(music),1)')) or
|
|
||||||
not xbmc.getCondVisibility('Integer.IsGreater(Playlist.Length(video),1)'))):
|
|
||||||
# widgets do not fill artwork correctly
|
# widgets do not fill artwork correctly
|
||||||
log.info("Detected widget.")
|
log.info("Detected widget.")
|
||||||
raise IndexError
|
raise IndexError
|
||||||
|
@ -158,6 +166,12 @@ class PlaybackUtils(object):
|
||||||
url = putils.PlayUtils(intro, listitem).get_play_url()
|
url = putils.PlayUtils(intro, listitem).get_play_url()
|
||||||
log.info("Adding Intro: %s", url)
|
log.info("Adding Intro: %s", url)
|
||||||
|
|
||||||
|
pb = PlaybackUtils(intro)
|
||||||
|
pb.set_artwork(listitem, intro['Type'])
|
||||||
|
|
||||||
|
if self._detect_widgets():
|
||||||
|
pb.set_listitem(listitem)
|
||||||
|
|
||||||
self.stack.append([url, listitem])
|
self.stack.append([url, listitem])
|
||||||
|
|
||||||
window('emby.skip.%s' % self.item['Id'], value="true")
|
window('emby.skip.%s' % self.item['Id'], value="true")
|
||||||
|
|
|
@ -136,6 +136,9 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
#self.set_audio_subs(item.get('forcedaudio'), item.get('forcedsubs'))
|
#self.set_audio_subs(item.get('forcedaudio'), item.get('forcedsubs'))
|
||||||
|
|
||||||
|
# Prevent manually mark as watched in Kodi monitor
|
||||||
|
window('emby.skip.%s' % item_id, value="true")
|
||||||
|
|
||||||
customseek = window('emby_customPlaylist.seektime')
|
customseek = window('emby_customPlaylist.seektime')
|
||||||
if window('emby_customPlaylist') == "true" and customseek:
|
if window('emby_customPlaylist') == "true" and customseek:
|
||||||
# Start at, when using custom playlist (play to Kodi from webclient)
|
# Start at, when using custom playlist (play to Kodi from webclient)
|
||||||
|
@ -455,9 +458,6 @@ class Player(xbmc.Player):
|
||||||
media_type = data['Type']
|
media_type = data['Type']
|
||||||
playMethod = data['playmethod']
|
playMethod = data['playmethod']
|
||||||
|
|
||||||
# Prevent manually mark as watched in Kodi monitor
|
|
||||||
window('emby.skip.%s' % itemid, value="true")
|
|
||||||
|
|
||||||
self.stopPlayback(data)
|
self.stopPlayback(data)
|
||||||
|
|
||||||
if currentPosition and runtime:
|
if currentPosition and runtime:
|
||||||
|
|
Loading…
Reference in a new issue