diff --git a/agent/internal/httpapi/resources.go b/agent/internal/httpapi/resources.go index 9c14b9e..a52bb91 100644 --- a/agent/internal/httpapi/resources.go +++ b/agent/internal/httpapi/resources.go @@ -43,8 +43,9 @@ func (s *Server) handleResourcesStatus(w http.ResponseWriter, r *http.Request) { fgPath := filepath.Join(s.agentCfg.ModelsDir, "face_gallery.db") if st, err := os.Stat(fgPath); err == nil { sha, _ := fileSHA256HTTP(fgPath) + name := strings.TrimSuffix(filepath.Base(fgPath), filepath.Ext(fgPath)) resources = append(resources, installedResource{ - Name: "face_gallery_v1", + Name: name, ResourceType: "face_gallery", SHA256: sha, SizeBytes: st.Size(), @@ -95,7 +96,18 @@ func (s *Server) handleResourcesStatus(w http.ResponseWriter, r *http.Request) { return resources[i].Name < resources[j].Name }) - writeJSON(w, http.StatusOK, map[string]any{"resources": resources}) + // dedup by resource_type + name (face_gallery.db may appear both in modelsDir and resources/) + seen := make(map[string]bool, len(resources)) + deduped := make([]installedResource, 0, len(resources)) + for _, r := range resources { + key := r.ResourceType + "/" + r.Name + if !seen[key] { + seen[key] = true + deduped = append(deduped, r) + } + } + + writeJSON(w, http.StatusOK, map[string]any{"resources": deduped}) } // handleResourceUpload accepts a resource file upload. diff --git a/agent/rk3588-agent_linux_arm64 b/agent/rk3588-agent_linux_arm64 index 2bb2e11..66e513c 100755 Binary files a/agent/rk3588-agent_linux_arm64 and b/agent/rk3588-agent_linux_arm64 differ