aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/mbf/internal/pkgserver/api.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-17 13:07:12 +0900
committerOphestra <cat@gensokyo.uk>2026-05-17 15:56:53 +0900
commit30eb0d6a613ad268f6805ccbcdcabf158e7f526f (patch)
tree07e55baa52748fd139e183017eeb43f5f64cee59 /cmd/mbf/internal/pkgserver/api.go
parentc2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (diff)
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf/internal/pkgserver/api.go')
-rw-r--r--cmd/mbf/internal/pkgserver/api.go6
1 files changed, 3 insertions, 3 deletions
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