Provide more metadata for unsynced directory-like items like a show

This commit is contained in:
croneter 2019-07-13 14:47:43 +02:00
parent 84d4e5aa99
commit 3436035530

View file

@ -79,7 +79,6 @@ def generate_item(api):
def _generate_folder(api): def _generate_folder(api):
'''Generates "folder"/"directory" items that user can further navigate''' '''Generates "folder"/"directory" items that user can further navigate'''
art = api.artwork()
typus = '' typus = ''
if api.plex_type == v.PLEX_TYPE_GENRE: if api.plex_type == v.PLEX_TYPE_GENRE:
# Unfortunately, 'genre' is not yet supported by Kodi # Unfortunately, 'genre' is not yet supported by Kodi
@ -95,23 +94,34 @@ def _generate_folder(api):
typus = v.KODI_TYPE_ALBUM typus = v.KODI_TYPE_ALBUM
elif api.fast_key and '?collection=' in api.fast_key: elif api.fast_key and '?collection=' in api.fast_key:
typus = v.KODI_TYPE_SET typus = v.KODI_TYPE_SET
return { if typus and typus != v.KODI_TYPE_SET:
'title': api.title(), content = _generate_content(api)
'label': api.title(), content['type'] = typus
'file': api.directory_path(section_id=SECTION_ID, content['file'] = api.directory_path(section_id=SECTION_ID,
plex_type=PLEX_TYPE, plex_type=PLEX_TYPE,
old_key=KEY), old_key=KEY)
'icon': 'DefaultFolder.png', content['isFolder'] = True
'art': { content['IsPlayable'] = 'false'
'thumb': art['thumb'] if 'thumb' in art else return content
(art['poster'] if 'poster' in art else else:
'special://home/addons/%s/icon.png' % v.ADDON_ID), art = api.artwork()
'fanart': art['fanart'] if 'fanart' in art else return {
'special://home/addons/%s/fanart.jpg' % v.ADDON_ID}, 'title': api.title(),
'isFolder': True, 'label': api.title(),
'type': typus, 'file': api.directory_path(section_id=SECTION_ID,
'IsPlayable': 'false', plex_type=PLEX_TYPE,
} old_key=KEY),
'icon': 'DefaultFolder.png',
'art': {
'thumb': art['thumb'] if 'thumb' in art else
(art['poster'] if 'poster' in art else
'special://home/addons/%s/icon.png' % v.ADDON_ID),
'fanart': art['fanart'] if 'fanart' in art else
'special://home/addons/%s/fanart.jpg' % v.ADDON_ID},
'isFolder': True,
'type': typus,
'IsPlayable': 'false',
}
def _generate_content(api): def _generate_content(api):