From 80e2ad49085294f1e6b2b84616701ab4e23bdbfe Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 8 Mar 2017 17:02:26 +0100 Subject: [PATCH] Tweaking of browse by folder --- resources/lib/entrypoint.py | 18 ++++++------------ resources/lib/variables.py | 8 +++----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index f693e49e..65f5f0fa 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -862,7 +862,6 @@ def browse_plex(key=None, plex_section_id=None): log.error('Could not browse to %s' % key) return xbmcplugin.endOfDirectory(HANDLE, False) - directory = False photos = False movies = False clips = False @@ -875,7 +874,6 @@ def browse_plex(key=None, plex_section_id=None): for item in xml: typus = item.attrib.get('type') if item.tag == 'Directory': - directory = True __build_folder(item) else: __build_item(item) @@ -899,19 +897,15 @@ def browse_plex(key=None, plex_section_id=None): musicvideos = True # Set the correct content type - if directory is True: - xbmcplugin.setContent(HANDLE, 'files') - sort_methods = v.SORT_METHODS_DIRECTORY - elif photos is True: - # E.g. Plex foto sections with videos (both!!) - xbmcplugin.setContent(HANDLE, 'files') - sort_methods = v.SORT_METHODS_PHOTOS + if movies is True: + xbmcplugin.setContent(HANDLE, 'movies') + sort_methods = v.SORT_METHODS_MOVIES elif clips is True: xbmcplugin.setContent(HANDLE, 'movies') sort_methods = v.SORT_METHODS_CLIPS - elif movies is True: - xbmcplugin.setContent(HANDLE, 'movies') - sort_methods = v.SORT_METHODS_MOVIES + elif photos is True: + xbmcplugin.setContent(HANDLE, 'files') + sort_methods = v.SORT_METHODS_PHOTOS elif tvshows is True: xbmcplugin.setContent(HANDLE, 'tvshows') sort_methods = v.SORT_METHOD_TVSHOWS diff --git a/resources/lib/variables.py b/resources/lib/variables.py index f28af541..dda52ac5 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -314,15 +314,13 @@ SORT_METHOD_TVSHOWS = ( SORT_METHODS_EPISODES = ( 'SORT_METHOD_UNSORTED', 'SORT_METHOD_TITLE', + 'SORT_METHOD_EPISODE', 'SORT_METHOD_DURATION', 'SORT_METHOD_VIDEO_RATING', 'SORT_METHOD_VIDEO_USER_RATING', - 'SORT_METHOD_EPISODE', - 'SORT_METHOD_VIDEO_SORT_TITLE', 'SORT_METHOD_MPAA_RATING', - 'SORT_METHOD_COUNTRY', - 'SORT_METHOD_STUDIO', - 'SORT_METHOD_GENRE', + 'SORT_METHOD_FILE', + 'SORT_METHOD_FULLPATH', ) SORT_METHODS_SONGS = (