Merge pull request #1352 from huchenlei/fix_installed_module_name

Use module name without @Version in /customnode/installed object key
This commit is contained in:
Chenlei Hu 2024-12-19 15:25:56 -08:00 committed by GitHub
commit aab45dff44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -546,25 +546,33 @@ def populate_markdown(x):
async def installed_list(request):
result = {}
for x in folder_paths.get_folder_paths('custom_nodes'):
for y in os.listdir(x):
if y.endswith('.disabled') or y == '__pycache__' or y.endswith('.py') or y.endswith('.example'):
for module_name in os.listdir(x):
if (
module_name.endswith('.disabled') or
module_name == '__pycache__' or
module_name.endswith('.py') or
module_name.endswith('.example') or
module_name.endswith('.pyc')
):
continue
spec = y.split('@')
spec = module_name.split('@')
if len(spec) == 2:
node_package_name = spec[0]
ver = spec[1].replace('_', '.')
if ver == 'nightly':
ver = None
else:
node_package_name = module_name
ver = None
# extract commit hash
if ver is None:
ver = core.get_commit_hash(os.path.join(x, y))
ver = core.get_commit_hash(os.path.join(x, node_package_name))
result[y] = ver
result[node_package_name] = ver
return web.json_response(result, content_type='application/json')