From 30eb0d6a613ad268f6805ccbcdcabf158e7f526f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 17 May 2026 13:07:12 +0900 Subject: internal/rosa: key metadata by string For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra --- cmd/mbf/internal/pkgserver/api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/mbf/internal/pkgserver/api.go') diff --git a/cmd/mbf/internal/pkgserver/api.go b/cmd/mbf/internal/pkgserver/api.go index 599ea522..e73b8bbe 100644 --- a/cmd/mbf/internal/pkgserver/api.go +++ b/cmd/mbf/internal/pkgserver/api.go @@ -30,7 +30,7 @@ var ( // handleInfo writes constant system information. func handleInfo(w http.ResponseWriter, _ *http.Request) { infoPayloadOnce.Do(func() { - infoPayload.Count = int(rosa.PresetUnexportedStart) + infoPayload.Count = int(rosa.Native().Count()) infoPayload.HakureiVersion = info.Version() }) // TODO(mae): cache entire response if no additional fields are planned @@ -91,7 +91,7 @@ func (index *packageIndex) handleGet(w http.ResponseWriter, r *http.Request) { if err != nil || i >= len(index.sorts[0]) || i < 0 { http.Error( w, "index must be an integer between 0 and "+ - strconv.Itoa(int(rosa.PresetUnexportedStart-1)), + strconv.Itoa(len(index.sorts[0])-1), http.StatusBadRequest, ) return @@ -125,7 +125,7 @@ func (index *packageIndex) handleSearch(w http.ResponseWriter, r *http.Request) if err != nil || i >= len(index.sorts[0]) || i < 0 { http.Error( w, "index must be an integer between 0 and "+ - strconv.Itoa(int(rosa.PresetUnexportedStart-1)), + strconv.Itoa(len(index.sorts[0])-1), http.StatusBadRequest, ) return -- cgit v1.3.1