mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
added support for intros
This commit is contained in:
parent
23e039fd43
commit
8f8f39bb75
1 changed files with 12 additions and 1 deletions
|
@ -68,6 +68,17 @@ class PlaybackUtils():
|
||||||
reasonableTicks = int(userData.get("PlaybackPositionTicks")) / 1000
|
reasonableTicks = int(userData.get("PlaybackPositionTicks")) / 1000
|
||||||
seekTime = reasonableTicks / 10000
|
seekTime = reasonableTicks / 10000
|
||||||
|
|
||||||
|
# check for any intros - if we have any play them when the movie/show is not being resumed
|
||||||
|
url = "{server}/mediabrowser/Users/{UserId}/Items/%s/Intros?format=json&ImageTypeLimit=1&Fields=Etag" % id
|
||||||
|
intros = self.downloadUtils.downloadUrl(url)
|
||||||
|
if(intros != "" and intros.get("Items") != None and seekTime == 0):
|
||||||
|
introsId = []
|
||||||
|
for intro in intros[u'Items']:
|
||||||
|
introid = intro[u'Id']
|
||||||
|
introsId.append(introid)
|
||||||
|
introsId.append(id)
|
||||||
|
return self.PLAYAllItems(introsId, startPositionTicks=None)
|
||||||
|
|
||||||
playurl = PlayUtils().getPlayUrl(server, id, result)
|
playurl = PlayUtils().getPlayUrl(server, id, result)
|
||||||
if playurl == False:
|
if playurl == False:
|
||||||
#xbmcgui.Dialog().ok('Warning', 'Failed to launch playback.')
|
#xbmcgui.Dialog().ok('Warning', 'Failed to launch playback.')
|
||||||
|
@ -149,7 +160,7 @@ class PlaybackUtils():
|
||||||
self.setListItemProps(server, id, listItem, result)
|
self.setListItemProps(server, id, listItem, result)
|
||||||
xbmc.Player().play(playurl,listItem)
|
xbmc.Player().play(playurl,listItem)
|
||||||
else:
|
else:
|
||||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listItem)
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listItem)
|
||||||
|
|
||||||
def setArt(self, list,name,path):
|
def setArt(self, list,name,path):
|
||||||
if name=='thumb' or name=='fanart_image' or name=='small_poster' or name=='tiny_poster' or name == "medium_landscape" or name=='medium_poster' or name=='small_fanartimage' or name=='medium_fanartimage' or name=='fanart_noindicators':
|
if name=='thumb' or name=='fanart_image' or name=='small_poster' or name=='tiny_poster' or name == "medium_landscape" or name=='medium_poster' or name=='small_fanartimage' or name=='medium_fanartimage' or name=='fanart_noindicators':
|
||||||
|
|
Loading…
Reference in a new issue