fixed video listitem issues for krypton

This commit is contained in:
Sebastian S 2019-01-15 07:42:43 +01:00
parent 9b8574b6a6
commit 749d0e92e4

View file

@ -302,12 +302,26 @@ class Actions(object):
obj['Video'] = API.video_streams(obj['Video'] or [], obj['Container'])
obj['Audio'] = API.audio_streams(obj['Audio'] or [])
obj['Streams'] = API.media_streams(obj['Video'], obj['Audio'], obj['Subtitles'])
obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or "special://home/addons/plugin.video.emby/icon.png"
obj['Artwork']['Thumb'] = obj['Artwork']['Thumb'] or "special://home/addons/plugin.video.emby/fanart.jpg"
obj['Artwork']['Backdrop'] = obj['Artwork']['Backdrop'] or ["special://home/addons/plugin.video.emby/fanart.jpg"]
obj['ChildCount'] = obj['ChildCount'] or 0
obj['RecursiveCount'] = obj['RecursiveCount'] or 0
obj['Unwatched'] = obj['Unwatched'] or 0
obj['Artwork']['Backdrop'] = obj['Artwork']['Backdrop'] or []
obj['Artwork']['Thumb'] = obj['Artwork']['Thumb'] or ""
if obj['Type'] == 'Video' and not obj['Type'] == 'Trailer':
obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or "special://home/addons/plugin.video.emby/icon.png"
else:
obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or obj['Artwork']['Thumb'] or (obj['Artwork']['Backdrop'][0] if len(obj['Artwork']['Backdrop']) else "special://home/addons/plugin.video.emby/fanart.jpg")
obj['Artwork']['Primary'] += "&KodiTrailer=true" if obj['Type'] == 'Trailer' else "&KodiCinemaMode=true"
obj['Artwork']['Backdrop'] = [obj['Artwork']['Primary']]
self.set_artwork(obj['Artwork'], listitem, obj['Type'])
if obj['Type'] == 'Video' or obj['Type'] == 'Trailer':
listitem.setArt({'poster': ""}) # Clear the poster value for intros / trailers to prevent issues in skins
listitem.setIconImage('DefaultVideo.png')
listitem.setThumbnailImage(obj['Artwork']['Primary'])
if obj['Premiere']:
obj['Premiere'] = obj['Premiere'].split('T')[0]
@ -333,30 +347,17 @@ class Actions(object):
'tagline': obj['Tagline'],
'writer': obj['Writers'],
'premiered': obj['Premiere'],
'aired': obj['Premiere'],
'votes': obj['Votes'],
'dateadded': obj['DateAdded'],
'aired': obj['Year'],
'date': obj['FileDate'],
'dbid': obj['DbId']
}
listitem.setCast(API.get_actors())
if obj['Type'] == 'Video':
listitem.setIconImage('DefaultVideo.png')
listitem.setThumbnailImage(obj['Artwork']['Primary'] or obj['Artwork']['Thumb'])
else:
listitem.setIconImage(obj['Artwork']['Thumb'])
listitem.setThumbnailImage(obj['Artwork']['Primary'])
self.set_artwork(obj['Artwork'], listitem, obj['Type'])
if not obj['Artwork']['Backdrop']:
listitem.setArt({'fanart': obj['Artwork']['Primary']})
if obj['Premiere']:
metadata['premieredate'] = obj['Premiere']
metadata['date'] = obj['Premiere']
if obj['Type'] == 'Episode':
metadata.update({
'mediatype': "episode",
@ -366,7 +367,8 @@ class Actions(object):
'episode': obj['Index'] or 0,
'sortepisode': obj['Index'] or 0,
'lastplayed': obj['DatePlayed'],
'duration': obj['Runtime']
'duration': obj['Runtime'],
'aired': obj['Premiere'],
})
elif obj['Type'] == 'Season':
@ -422,10 +424,10 @@ class Actions(object):
metadata.update({
'mediatype': "video",
'lastplayed': obj['DatePlayed'],
'year': obj['Year'],
'duration': obj['Runtime']
})
if is_video:
listitem.setProperty('totaltime', str(obj['Runtime']))