dir buttons start with / so only the correct dir will be shown and not dirs with a substrings as name from the dir

This commit is contained in:
Tom Haelbich 2023-11-12 14:14:16 +01:00
parent 4afaaf8a02
commit f6762d2ad9
1 changed files with 3 additions and 2 deletions

View File

@ -138,8 +138,9 @@ class ExtraNetworksPage:
continue continue
subdir = os.path.abspath(x)[len(parentdir):].replace("\\", "/") subdir = os.path.abspath(x)[len(parentdir):].replace("\\", "/")
while subdir.startswith("/"):
subdir = subdir[1:] if not subdir.startswith("/"):
subdir = "/" + subdir
is_empty = len(os.listdir(x)) == 0 is_empty = len(os.listdir(x)) == 0
if not is_empty and not subdir.endswith("/"): if not is_empty and not subdir.endswith("/"):