forked from nite/go-igdb
u
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *igdb) GetPlatformTypes(query string) ([]*pb.PlatformType, error) {
|
||||
func (g *Client) GetPlatformTypes(query string) ([]*pb.PlatformType, error) {
|
||||
resp, err := g.Request("https://api.igdb.com/v4/platform_types.pb", query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
@@ -27,7 +27,7 @@ func (g *igdb) GetPlatformTypes(query string) ([]*pb.PlatformType, error) {
|
||||
return data.Platformtypes, nil
|
||||
}
|
||||
|
||||
func (g *igdb) GetPlatformTypeByID(id uint64) (*pb.PlatformType, error) {
|
||||
func (g *Client) GetPlatformTypeByID(id uint64) (*pb.PlatformType, error) {
|
||||
query := fmt.Sprintf(`where id=%d; fields *;`, id)
|
||||
platformTypes, err := g.GetPlatformTypes(query)
|
||||
if err != nil {
|
||||
@@ -36,7 +36,7 @@ func (g *igdb) GetPlatformTypeByID(id uint64) (*pb.PlatformType, error) {
|
||||
return platformTypes[0], nil
|
||||
}
|
||||
|
||||
func (g *igdb) GetPlatformTypesByIDs(ids []uint64) ([]*pb.PlatformType, error) {
|
||||
func (g *Client) GetPlatformTypesByIDs(ids []uint64) ([]*pb.PlatformType, error) {
|
||||
idStrSlice := make([]string, len(ids))
|
||||
for i, id := range ids {
|
||||
idStrSlice[i] = fmt.Sprintf("%d", id)
|
||||
@@ -47,7 +47,7 @@ func (g *igdb) GetPlatformTypesByIDs(ids []uint64) ([]*pb.PlatformType, error) {
|
||||
return g.GetPlatformTypes(idStr)
|
||||
}
|
||||
|
||||
func (g *igdb) GetPlatformTypesLength() (int, error) {
|
||||
func (g *Client) GetPlatformTypesLength() (int, error) {
|
||||
query := `fields *; sort id desc; limit 1;`
|
||||
platformTypes, err := g.GetPlatformTypes(query)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user