mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-29 22:04:25 +02:00
Sort models alphabetically
This commit is contained in:
parent
5c6c2303ba
commit
e0f22d29e8
@ -182,7 +182,7 @@ def getModels():
|
|||||||
def scan_directory(directory, suffixes):
|
def scan_directory(directory, suffixes):
|
||||||
nonlocal models_scanned
|
nonlocal models_scanned
|
||||||
tree = []
|
tree = []
|
||||||
for entry in os.scandir(directory):
|
for entry in sorted(os.scandir(directory), key = lambda entry: (entry.is_file(), entry.name.lower())):
|
||||||
if entry.is_file():
|
if entry.is_file():
|
||||||
matching_suffix = list(filter(lambda s: entry.name.endswith(s), suffixes))
|
matching_suffix = list(filter(lambda s: entry.name.endswith(s), suffixes))
|
||||||
if len(matching_suffix) == 0: continue
|
if len(matching_suffix) == 0: continue
|
||||||
|
Loading…
Reference in New Issue
Block a user