From a12b5033b9df90a1365cfb93720f719602787cee Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 8 Mar 2017 17:53:43 +0100 Subject: [PATCH] Rewire Plex photo navigation --- resources/lib/entrypoint.py | 10 +++++++--- resources/lib/videonodes.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 65f5f0fa..3a077484 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -874,7 +874,7 @@ def browse_plex(key=None, plex_section_id=None): for item in xml: typus = item.attrib.get('type') if item.tag == 'Directory': - __build_folder(item) + __build_folder(item, plex_section_id=plex_section_id) else: __build_item(item) if typus == v.PLEX_TYPE_PHOTO: @@ -940,11 +940,15 @@ def browse_plex(key=None, plex_section_id=None): cacheToDisc=settings('enableTextureCache') == 'true') -def __build_folder(xml_element): +def __build_folder(xml_element, plex_section_id=None): url = "plugin://%s/" % v.ADDON_ID + key = xml_element.attrib.get('fastKey', xml_element.attrib.get('key')) + if not key.startswith('/'): + key = '/library/sections/%s/%s' % (plex_section_id, key) params = { 'mode': "browseplex", - 'key': xml_element.attrib.get('key') + 'key': key, + 'id': plex_section_id } listitem = ListItem(xml_element.attrib.get('title')) listitem.setArt({'thumb': xml_element.attrib.get('thumb'), diff --git a/resources/lib/videonodes.py b/resources/lib/videonodes.py index 6b9fb4a8..3d16fd91 100644 --- a/resources/lib/videonodes.py +++ b/resources/lib/videonodes.py @@ -102,7 +102,7 @@ class VideoNodes(object): return if mediatype == "photos": - path = "plugin://plugin.video.plexkodiconnect/?id=%s&mode=getsubfolders" % indexnumber + path = "plugin://plugin.video.plexkodiconnect?mode=browseplex&key=/library/sections/%s&id=%s" % (viewid, viewid) window('Plex.nodes.%s.index' % indexnumber, value=path)