forked from nite/go-igdb
u
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValues(query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValues(query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||
resp, err := g.Request("https://api.igdb.com/v4/game_version_feature_values.pb", query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
@@ -27,7 +27,7 @@ func (g *igdb) GetGameVersionFeatureValues(query string) ([]*pb.GameVersionFeatu
|
||||
return data.Gameversionfeaturevalues, nil
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValueByID(id uint64) (*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValueByID(id uint64) (*pb.GameVersionFeatureValue, error) {
|
||||
query := fmt.Sprintf(`where id=%d; fields *;`, id)
|
||||
gameVersionFeatureValues, err := g.GetGameVersionFeatureValues(query)
|
||||
if err != nil {
|
||||
@@ -36,7 +36,7 @@ func (g *igdb) GetGameVersionFeatureValueByID(id uint64) (*pb.GameVersionFeature
|
||||
return gameVersionFeatureValues[0], nil
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesByIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesByIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
idStrSlice := make([]string, len(ids))
|
||||
for i, id := range ids {
|
||||
idStrSlice[i] = fmt.Sprintf("%d", id)
|
||||
@@ -47,12 +47,12 @@ func (g *igdb) GetGameVersionFeatureValuesByIDs(ids []uint64) ([]*pb.GameVersion
|
||||
return g.GetGameVersionFeatureValues(idStr)
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesByGameID(id uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesByGameID(id uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
query := fmt.Sprintf(`where game = %d; fields *;`, id)
|
||||
return g.GetGameVersionFeatureValues(query)
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesByGameIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesByGameIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
idStrSlice := make([]string, len(ids))
|
||||
for i, id := range ids {
|
||||
idStrSlice[i] = fmt.Sprintf("%d", id)
|
||||
@@ -63,12 +63,12 @@ func (g *igdb) GetGameVersionFeatureValuesByGameIDs(ids []uint64) ([]*pb.GameVer
|
||||
return g.GetGameVersionFeatureValues(idStr)
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesByGameVersionFeatureID(id uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesByGameVersionFeatureID(id uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
query := fmt.Sprintf(`where game_version_feature = %d; fields *;`, id)
|
||||
return g.GetGameVersionFeatureValues(query)
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesByGameVersionFeatureIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesByGameVersionFeatureIDs(ids []uint64) ([]*pb.GameVersionFeatureValue, error) {
|
||||
idStrSlice := make([]string, len(ids))
|
||||
for i, id := range ids {
|
||||
idStrSlice[i] = fmt.Sprintf("%d", id)
|
||||
@@ -79,7 +79,7 @@ func (g *igdb) GetGameVersionFeatureValuesByGameVersionFeatureIDs(ids []uint64)
|
||||
return g.GetGameVersionFeatureValues(idStr)
|
||||
}
|
||||
|
||||
func (g *igdb) GetGameVersionFeatureValuesLength() (int, error) {
|
||||
func (g *Client) GetGameVersionFeatureValuesLength() (int, error) {
|
||||
query := `fields *; sort id desc; limit 1;`
|
||||
gameVersionFeatureValues, err := g.GetGameVersionFeatureValues(query)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user