mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 18:10:08 +00:00
[Manager] Update Algolia mappings (#4230)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,13 @@ const RETRIEVE_ATTRIBUTES: SearchAttribute[] = [
|
||||
'latest_version_status',
|
||||
'comfy_node_extract_status',
|
||||
'id',
|
||||
'icon_url'
|
||||
'icon_url',
|
||||
'github_stars',
|
||||
'supported_os',
|
||||
'supported_comfyui_version',
|
||||
'supported_comfyui_frontend_version',
|
||||
'supported_accelerators',
|
||||
'banner_url'
|
||||
]
|
||||
|
||||
const searchPacksCache = new QuickLRU<string, SearchPacksResult>({
|
||||
@@ -86,9 +92,19 @@ const toRegistryPack = memoize(
|
||||
icon: algoliaNode.icon_url,
|
||||
latest_version: toRegistryLatestVersion(algoliaNode),
|
||||
publisher: toRegistryPublisher(algoliaNode),
|
||||
created_at: algoliaNode.create_time,
|
||||
category: algoliaNode.category,
|
||||
author: algoliaNode.author,
|
||||
tags: algoliaNode.tags,
|
||||
github_stars: algoliaNode.github_stars,
|
||||
supported_os: algoliaNode.supported_os,
|
||||
supported_comfyui_version: algoliaNode.supported_comfyui_version,
|
||||
supported_comfyui_frontend_version:
|
||||
algoliaNode.supported_comfyui_frontend_version,
|
||||
supported_accelerators: algoliaNode.supported_accelerators,
|
||||
banner_url: algoliaNode.banner_url,
|
||||
// @ts-expect-error comfy_nodes also not in node info
|
||||
comfy_nodes: algoliaNode.comfy_nodes,
|
||||
create_time: algoliaNode.create_time
|
||||
comfy_nodes: algoliaNode.comfy_nodes
|
||||
}
|
||||
},
|
||||
(algoliaNode: AlgoliaNodePack) => algoliaNode.id
|
||||
@@ -187,9 +203,7 @@ export const useAlgoliaSearchProvider = (): NodePackSearchProvider => {
|
||||
case SortableAlgoliaField.Downloads:
|
||||
return pack.downloads ?? 0
|
||||
case SortableAlgoliaField.Created: {
|
||||
// TODO: add create time to backend return type
|
||||
// @ts-expect-error create_time is not in the RegistryNodePack type
|
||||
const createTime = pack.create_time
|
||||
const createTime = pack.created_at
|
||||
return createTime ? new Date(createTime).getTime() : 0
|
||||
}
|
||||
case SortableAlgoliaField.Updated:
|
||||
|
||||
@@ -59,6 +59,15 @@ export interface AlgoliaNodePack {
|
||||
'comfy_node_extract_status'
|
||||
>
|
||||
icon_url: RegistryNodePack['icon']
|
||||
category: RegistryNodePack['category']
|
||||
author: RegistryNodePack['author']
|
||||
tags: RegistryNodePack['tags']
|
||||
github_stars: RegistryNodePack['github_stars']
|
||||
supported_os: RegistryNodePack['supported_os']
|
||||
supported_comfyui_version: RegistryNodePack['supported_comfyui_version']
|
||||
supported_comfyui_frontend_version: RegistryNodePack['supported_comfyui_frontend_version']
|
||||
supported_accelerators: RegistryNodePack['supported_accelerators']
|
||||
banner_url: RegistryNodePack['banner_url']
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,8 +108,17 @@ describe('useAlgoliaSearchProvider', () => {
|
||||
id: 'publisher-1',
|
||||
name: 'publisher-1'
|
||||
},
|
||||
create_time: '2024-01-01T00:00:00Z',
|
||||
comfy_nodes: ['LoadImage', 'SaveImage']
|
||||
created_at: '2024-01-01T00:00:00Z',
|
||||
comfy_nodes: ['LoadImage', 'SaveImage'],
|
||||
category: undefined,
|
||||
author: undefined,
|
||||
tags: undefined,
|
||||
github_stars: undefined,
|
||||
supported_os: undefined,
|
||||
supported_comfyui_version: undefined,
|
||||
supported_comfyui_frontend_version: undefined,
|
||||
supported_accelerators: undefined,
|
||||
banner_url: undefined
|
||||
})
|
||||
})
|
||||
|
||||
@@ -253,7 +262,7 @@ describe('useAlgoliaSearchProvider', () => {
|
||||
version: '1.0.0',
|
||||
createdAt: '2024-01-15T10:00:00Z'
|
||||
},
|
||||
create_time: '2024-01-01T10:00:00Z'
|
||||
created_at: '2024-01-01T10:00:00Z'
|
||||
}
|
||||
|
||||
it('should return correct values for each sort field', () => {
|
||||
|
||||
Reference in New Issue
Block a user