From 12effd643fb0513ed90305779389d8ec95a9bb85 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 3 May 2020 17:13:17 -0700 Subject: [PATCH] Sort folders and files in file browser --- plexpy/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/helpers.py b/plexpy/helpers.py index cb79428a..e2e6f161 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -1229,7 +1229,7 @@ def browse_path(path=None, include_hidden=False, filter_ext=''): output.append(out) for root, dirs, files in os.walk(path): - for d in dirs: + for d in sorted(dirs): if not include_hidden and d.startswith('.'): continue dir_path = os.path.join(root, d) @@ -1241,7 +1241,7 @@ def browse_path(path=None, include_hidden=False, filter_ext=''): 'icon': 'folder' } output.append(out) - for f in files: + for f in sorted(files): if not include_hidden and f.startswith('.'): continue if filter_ext and not f.endswith(filter_ext):