Merge pull request #297 from mcarlton00/addon-menu

Improve addon menu
This commit is contained in:
Abby 2020-05-16 17:45:15 +01:00 committed by GitHub
commit 4b679eab74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View file

@ -160,14 +160,7 @@ def listing():
LOG.debug("--[ listing/%s/%s ] %s", node, label, path) LOG.debug("--[ listing/%s/%s ] %s", node, label, path)
if path: if path:
if xbmc.getCondVisibility('Window.IsActive(Pictures)') and node in ('photos', 'homevideos'):
directory(label, path, artwork=artwork)
elif xbmc.getCondVisibility('Window.IsActive(Videos)') and node not in ('photos', 'music', 'audiobooks'):
directory(label, path, artwork=artwork, context=context) directory(label, path, artwork=artwork, context=context)
elif xbmc.getCondVisibility('Window.IsActive(Music)') and node in ('music'):
directory(label, path, artwork=artwork, context=context)
elif not xbmc.getCondVisibility('Window.IsActive(Videos) | Window.IsActive(Pictures) | Window.IsActive(Music)'):
directory(label, path, artwork=artwork)
for server in servers: for server in servers:
context = [] context = []

View file

@ -166,14 +166,11 @@ class Views(object):
def get_libraries(self): def get_libraries(self):
try: try:
libraries = self.server.jellyfin.get_media_folders()['Items'] libraries = self.server.jellyfin.get_views()['Items']
views = self.server.jellyfin.get_views()['Items']
except Exception as error: except Exception as error:
LOG.exception(error) LOG.exception(error)
raise IndexError("Unable to retrieve libraries: %s" % error) raise IndexError("Unable to retrieve libraries: %s" % error)
libraries.extend([x for x in views if x['Id'] not in [y['Id'] for y in libraries]])
return libraries return libraries
def get_views(self): def get_views(self):