fix: resolve path (#132)

This commit is contained in:
Hayden
2025-02-10 17:00:08 +08:00
committed by GitHub
parent 9e95e7bd74
commit fcea052dde

View File

@@ -120,7 +120,11 @@ class ModelManager:
folders, *others = folder_paths.folder_names_and_paths[folder]
def get_file_info(entry: os.DirEntry[str], base_path: str, path_index: int):
fullname = utils.normalize_path(entry.path).replace(f"{base_path}/", "")
prefix_path = utils.normalize_path(base_path)
if not prefix_path.endswith("/"):
prefix_path = f"{prefix_path}/"
fullname = utils.normalize_path(entry.path).replace(prefix_path, "")
basename = os.path.splitext(fullname)[0]
extension = os.path.splitext(fullname)[1]