This commit is contained in:
2025-04-05 16:29:30 +11:00
parent dab30b4938
commit 35c27b28a3
73 changed files with 444 additions and 444 deletions

View File

@@ -9,7 +9,7 @@ import (
"google.golang.org/protobuf/proto"
)
func (g *igdb) GetEventLogos(query string) ([]*pb.EventLogo, error) {
func (g *Client) GetEventLogos(query string) ([]*pb.EventLogo, error) {
resp, err := g.Request("https://api.igdb.com/v4/event_logos.pb", query)
if err != nil {
return nil, fmt.Errorf("failed to request: %w", err)
@@ -27,7 +27,7 @@ func (g *igdb) GetEventLogos(query string) ([]*pb.EventLogo, error) {
return data.Eventlogos, nil
}
func (g *igdb) GetEventLogoByID(id uint64) (*pb.EventLogo, error) {
func (g *Client) GetEventLogoByID(id uint64) (*pb.EventLogo, error) {
query := fmt.Sprintf(`where id=%d; fields *;`, id)
eventLogos, err := g.GetEventLogos(query)
if err != nil {
@@ -36,7 +36,7 @@ func (g *igdb) GetEventLogoByID(id uint64) (*pb.EventLogo, error) {
return eventLogos[0], nil
}
func (g *igdb) GetEventLogosByIDs(ids []uint64) ([]*pb.EventLogo, error) {
func (g *Client) GetEventLogosByIDs(ids []uint64) ([]*pb.EventLogo, error) {
idStrSlice := make([]string, len(ids))
for i, id := range ids {
idStrSlice[i] = fmt.Sprintf("%d", id)
@@ -47,12 +47,12 @@ func (g *igdb) GetEventLogosByIDs(ids []uint64) ([]*pb.EventLogo, error) {
return g.GetEventLogos(idStr)
}
func (g *igdb) GetEventLogosByEventID(id uint64) ([]*pb.EventLogo, error) {
func (g *Client) GetEventLogosByEventID(id uint64) ([]*pb.EventLogo, error) {
query := fmt.Sprintf(`where event = %d; fields *;`, id)
return g.GetEventLogos(query)
}
func (g *igdb) GetEventLogosByEventIDs(ids []uint64) ([]*pb.EventLogo, error) {
func (g *Client) GetEventLogosByEventIDs(ids []uint64) ([]*pb.EventLogo, error) {
idStrSlice := make([]string, len(ids))
for i, id := range ids {
idStrSlice[i] = fmt.Sprintf("%d", id)
@@ -63,7 +63,7 @@ func (g *igdb) GetEventLogosByEventIDs(ids []uint64) ([]*pb.EventLogo, error) {
return g.GetEventLogos(idStr)
}
func (g *igdb) GetEventLogosLength() (int, error) {
func (g *Client) GetEventLogosLength() (int, error) {
query := `fields *; sort id desc; limit 1;`
eventLogos, err := g.GetEventLogos(query)
if err != nil {