update: add pool query to package page

This commit is contained in:
ngn
2024-08-26 00:51:20 +03:00
parent 6815f1a762
commit 5bf6876558
3 changed files with 21 additions and 3 deletions

View File

@ -8,6 +8,8 @@ import (
"io"
"os"
"path"
"strings"
"unicode"
"github.com/bigkevmcd/go-configparser"
)
@ -25,6 +27,21 @@ type Pool struct {
Dir string `json:"dir"`
}
func (p *Pool) ID() string {
var res string = ""
for _, c := range p.Display {
if unicode.IsDigit(c) || unicode.IsLetter(c) {
res += string(c)
continue
}
res += "-"
}
return strings.TrimSuffix(res, "-")
}
func (p *Pool) Load(list *[]Package) error {
var err error