152 cant click through some nested dirs in tree view (#157)

* fix: basename error

* prepare release 2.5.2
This commit is contained in:
Hayden
2025-03-03 14:36:13 +08:00
committed by GitHub
parent 8877c1599b
commit 1975e2056d
2 changed files with 4 additions and 4 deletions

View File

@@ -124,13 +124,13 @@ class ModelManager:
if not prefix_path.endswith("/"):
prefix_path = f"{prefix_path}/"
is_file = entry.is_file()
relative_path = utils.normalize_path(entry.path).replace(prefix_path, "")
sub_folder = os.path.dirname(relative_path)
filename = os.path.basename(relative_path)
basename = os.path.splitext(filename)[0]
extension = os.path.splitext(filename)[1]
basename = os.path.splitext(filename)[0] if is_file else filename
extension = os.path.splitext(filename)[1] if is_file else ""
is_file = entry.is_file()
if is_file and extension not in folder_paths.supported_pt_extensions:
return None