u
This commit is contained in:
		| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategories(query string) ([]*pb.AgeRatingCategory, error) { | ||||
| func (g *Client) GetAgeRatingCategories(query string) ([]*pb.AgeRatingCategory, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/age_rating_categories.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAgeRatingCategories(query string) ([]*pb.AgeRatingCategory, er | ||||
| 	return data.Ageratingcategories, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategoryByID(id uint64) (*pb.AgeRatingCategory, error) { | ||||
| func (g *Client) GetAgeRatingCategoryByID(id uint64) (*pb.AgeRatingCategory, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	ageRatingCategories, err := g.GetAgeRatingCategories(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAgeRatingCategoryByID(id uint64) (*pb.AgeRatingCategory, error | ||||
| 	return ageRatingCategories[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategoriesByIDs(ids []uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| func (g *Client) GetAgeRatingCategoriesByIDs(ids []uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetAgeRatingCategoriesByIDs(ids []uint64) ([]*pb.AgeRatingCategor | ||||
| 	return g.GetAgeRatingCategories(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategoriesByOrganizationID(id uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| func (g *Client) GetAgeRatingCategoriesByOrganizationID(id uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| 	query := fmt.Sprintf(`where organization = %d; fields *;`, id) | ||||
| 	return g.GetAgeRatingCategories(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategoriesByOrganizationIDs(ids []uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| func (g *Client) GetAgeRatingCategoriesByOrganizationIDs(ids []uint64) ([]*pb.AgeRatingCategory, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetAgeRatingCategoriesByOrganizationIDs(ids []uint64) ([]*pb.AgeR | ||||
| 	return g.GetAgeRatingCategories(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingCategoriesLength() (int, error) { | ||||
| func (g *Client) GetAgeRatingCategoriesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	ageRatingCategories, err := g.GetAgeRatingCategories(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptions(query string) ([]*pb.AgeRatingContentDescription, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptions(query string) ([]*pb.AgeRatingContentDescription, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/age_rating_content_descriptions.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAgeRatingContentDescriptions(query string) ([]*pb.AgeRatingCon | ||||
| 	return data.Ageratingcontentdescriptions, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionByID(id uint64) (*pb.AgeRatingContentDescription, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionByID(id uint64) (*pb.AgeRatingContentDescription, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	ageRatingContentDescriptions, err := g.GetAgeRatingContentDescriptions(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAgeRatingContentDescriptionByID(id uint64) (*pb.AgeRatingConte | ||||
| 	return ageRatingContentDescriptions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsByIDs(ids []uint64) ([]*pb.AgeRatingContentDescription, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsByIDs(ids []uint64) ([]*pb.AgeRatingContentDescription, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetAgeRatingContentDescriptionsByIDs(ids []uint64) ([]*pb.AgeRati | ||||
| 	return g.GetAgeRatingContentDescriptions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsLength() (int, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	ageRatingContentDescriptions, err := g.GetAgeRatingContentDescriptions(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsV2(query string) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsV2(query string) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/age_rating_content_descriptions_v2.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAgeRatingContentDescriptionsV2(query string) ([]*pb.AgeRatingC | ||||
| 	return data.Ageratingcontentdescriptionsv2, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionV2ByID(id uint64) (*pb.AgeRatingContentDescriptionV2, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionV2ByID(id uint64) (*pb.AgeRatingContentDescriptionV2, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	ageRatingContentDescriptions, err := g.GetAgeRatingContentDescriptionsV2(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAgeRatingContentDescriptionV2ByID(id uint64) (*pb.AgeRatingCon | ||||
| 	return ageRatingContentDescriptions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsV2ByIDs(ids []uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsV2ByIDs(ids []uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetAgeRatingContentDescriptionsV2ByIDs(ids []uint64) ([]*pb.AgeRa | ||||
| 	return g.GetAgeRatingContentDescriptionsV2(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsV2ByOrganizationID(id uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsV2ByOrganizationID(id uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| 	query := fmt.Sprintf(`where organization = %d; fields *;`, id) | ||||
| 	return g.GetAgeRatingContentDescriptionsV2(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsV2ByOrganizationIDs(ids []uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsV2ByOrganizationIDs(ids []uint64) ([]*pb.AgeRatingContentDescriptionV2, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetAgeRatingContentDescriptionsV2ByOrganizationIDs(ids []uint64) | ||||
| 	return g.GetAgeRatingContentDescriptionsV2(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingContentDescriptionsV2Length() (int, error) { | ||||
| func (g *Client) GetAgeRatingContentDescriptionsV2Length() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	ageRatingContentDescriptions, err := g.GetAgeRatingContentDescriptionsV2(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAgeRatingOrganizations(query string) ([]*pb.AgeRatingOrganization, error) { | ||||
| func (g *Client) GetAgeRatingOrganizations(query string) ([]*pb.AgeRatingOrganization, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/age_rating_organizations.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAgeRatingOrganizations(query string) ([]*pb.AgeRatingOrganizat | ||||
| 	return data.Ageratingorganizations, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingOrganizationByID(id uint64) (*pb.AgeRatingOrganization, error) { | ||||
| func (g *Client) GetAgeRatingOrganizationByID(id uint64) (*pb.AgeRatingOrganization, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	ageRatingOrganizations, err := g.GetAgeRatingOrganizations(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAgeRatingOrganizationByID(id uint64) (*pb.AgeRatingOrganizatio | ||||
| 	return ageRatingOrganizations[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingOrganizationsByIDs(ids []uint64) ([]*pb.AgeRatingOrganization, error) { | ||||
| func (g *Client) GetAgeRatingOrganizationsByIDs(ids []uint64) ([]*pb.AgeRatingOrganization, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetAgeRatingOrganizationsByIDs(ids []uint64) ([]*pb.AgeRatingOrga | ||||
| 	return g.GetAgeRatingOrganizations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingOrganizationsLength() (int, error) { | ||||
| func (g *Client) GetAgeRatingOrganizationsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	ageRatingOrganizations, err := g.GetAgeRatingOrganizations(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAgeRatings(query string) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatings(query string) ([]*pb.AgeRating, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/age_ratings.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAgeRatings(query string) ([]*pb.AgeRating, error) { | ||||
| 	return data.Ageratings, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingByID(id uint64) (*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingByID(id uint64) (*pb.AgeRating, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	ageRatings, err := g.GetAgeRatings(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAgeRatingByID(id uint64) (*pb.AgeRating, error) { | ||||
| 	return ageRatings[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsByIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingsByIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetAgeRatingsByIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| 	return g.GetAgeRatings(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsByOrganizationID(id uint64) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingsByOrganizationID(id uint64) ([]*pb.AgeRating, error) { | ||||
| 	query := fmt.Sprintf(`where organization = %d; fields *;`, id) | ||||
| 	return g.GetAgeRatings(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsByOrganizationIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingsByOrganizationIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetAgeRatingsByOrganizationIDs(ids []uint64) ([]*pb.AgeRating, er | ||||
| 	return g.GetAgeRatings(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsByAgeRatingCategoryID(id uint64) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingsByAgeRatingCategoryID(id uint64) ([]*pb.AgeRating, error) { | ||||
| 	query := fmt.Sprintf(`where rating_category = %d; fields *;`, id) | ||||
| 	return g.GetAgeRatings(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsByAgeRatingCategoryIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| func (g *Client) GetAgeRatingsByAgeRatingCategoryIDs(ids []uint64) ([]*pb.AgeRating, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetAgeRatingsByAgeRatingCategoryIDs(ids []uint64) ([]*pb.AgeRatin | ||||
| 	return g.GetAgeRatings(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAgeRatingsLength() (int, error) { | ||||
| func (g *Client) GetAgeRatingsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	ageRatings, err := g.GetAgeRatings(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetAlternativeNames(query string) ([]*pb.AlternativeName, error) { | ||||
| func (g *Client) GetAlternativeNames(query string) ([]*pb.AlternativeName, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/alternative_names.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetAlternativeNames(query string) ([]*pb.AlternativeName, error) | ||||
| 	return data.Alternativenames, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAlternativeNameByID(id uint64) (*pb.AlternativeName, error) { | ||||
| func (g *Client) GetAlternativeNameByID(id uint64) (*pb.AlternativeName, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	alternativeNames, err := g.GetAlternativeNames(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetAlternativeNameByID(id uint64) (*pb.AlternativeName, error) { | ||||
| 	return alternativeNames[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAlternativeNamesByIDs(ids []uint64) ([]*pb.AlternativeName, error) { | ||||
| func (g *Client) GetAlternativeNamesByIDs(ids []uint64) ([]*pb.AlternativeName, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetAlternativeNamesByIDs(ids []uint64) ([]*pb.AlternativeName, er | ||||
| 	return g.GetAlternativeNames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAlternativeNamesByGameID(id uint64) ([]*pb.AlternativeName, error) { | ||||
| func (g *Client) GetAlternativeNamesByGameID(id uint64) ([]*pb.AlternativeName, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetAlternativeNames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAlternativeNamesByGameIDs(ids []uint64) ([]*pb.AlternativeName, error) { | ||||
| func (g *Client) GetAlternativeNamesByGameIDs(ids []uint64) ([]*pb.AlternativeName, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetAlternativeNamesByGameIDs(ids []uint64) ([]*pb.AlternativeName | ||||
| 	return g.GetAlternativeNames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetAlternativeNamesLength() (int, error) { | ||||
| func (g *Client) GetAlternativeNamesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	alternativeNames, err := g.GetAlternativeNames(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										12
									
								
								artworks.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								artworks.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetArtworks(query string) ([]*pb.Artwork, error) { | ||||
| func (g *Client) GetArtworks(query string) ([]*pb.Artwork, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/artworks.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetArtworks(query string) ([]*pb.Artwork, error) { | ||||
| 	return data.Artworks, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetArtworkByID(id uint64) (*pb.Artwork, error) { | ||||
| func (g *Client) GetArtworkByID(id uint64) (*pb.Artwork, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	artworks, err := g.GetArtworks(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetArtworkByID(id uint64) (*pb.Artwork, error) { | ||||
| 	return artworks[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetArtworksByIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| func (g *Client) GetArtworksByIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetArtworksByIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| 	return g.GetArtworks(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetArtworksByGameID(id uint64) ([]*pb.Artwork, error) { | ||||
| func (g *Client) GetArtworksByGameID(id uint64) ([]*pb.Artwork, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetArtworks(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetArtworksByGameIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| func (g *Client) GetArtworksByGameIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetArtworksByGameIDs(ids []uint64) ([]*pb.Artwork, error) { | ||||
| 	return g.GetArtworks(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetArtworksLength() (int, error) { | ||||
| func (g *Client) GetArtworksLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	artworks, err := g.GetArtworks(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCharacterGenders(query string) ([]*pb.CharacterGender, error) { | ||||
| func (g *Client) GetCharacterGenders(query string) ([]*pb.CharacterGender, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/character_genders.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCharacterGenders(query string) ([]*pb.CharacterGender, error) | ||||
| 	return data.Charactergenders, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterGenderByID(id uint64) (*pb.CharacterGender, error) { | ||||
| func (g *Client) GetCharacterGenderByID(id uint64) (*pb.CharacterGender, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	characterGenders, err := g.GetCharacterGenders(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCharacterGenderByID(id uint64) (*pb.CharacterGender, error) { | ||||
| 	return characterGenders[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterGendersByIDs(ids []uint64) ([]*pb.CharacterGender, error) { | ||||
| func (g *Client) GetCharacterGendersByIDs(ids []uint64) ([]*pb.CharacterGender, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCharacterGendersByIDs(ids []uint64) ([]*pb.CharacterGender, er | ||||
| 	return g.GetCharacterGenders(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterGendersLength() (int, error) { | ||||
| func (g *Client) GetCharacterGendersLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	characterGenders, err := g.GetCharacterGenders(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCharacterMugShots(query string) ([]*pb.CharacterMugShot, error) { | ||||
| func (g *Client) GetCharacterMugShots(query string) ([]*pb.CharacterMugShot, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/character_mug_shots.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCharacterMugShots(query string) ([]*pb.CharacterMugShot, error | ||||
| 	return data.Charactermugshots, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterMugShotByID(id uint64) (*pb.CharacterMugShot, error) { | ||||
| func (g *Client) GetCharacterMugShotByID(id uint64) (*pb.CharacterMugShot, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	characterMugShots, err := g.GetCharacterMugShots(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCharacterMugShotByID(id uint64) (*pb.CharacterMugShot, error) | ||||
| 	return characterMugShots[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterMugShotsByIDs(ids []uint64) ([]*pb.CharacterMugShot, error) { | ||||
| func (g *Client) GetCharacterMugShotsByIDs(ids []uint64) ([]*pb.CharacterMugShot, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCharacterMugShotsByIDs(ids []uint64) ([]*pb.CharacterMugShot, | ||||
| 	return g.GetCharacterMugShots(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterMugShotsLength() (int, error) { | ||||
| func (g *Client) GetCharacterMugShotsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	characterMugShots, err := g.GetCharacterMugShots(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCharacterSpecies(query string) ([]*pb.CharacterSpecie, error) { | ||||
| func (g *Client) GetCharacterSpecies(query string) ([]*pb.CharacterSpecie, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/character_species.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCharacterSpecies(query string) ([]*pb.CharacterSpecie, error) | ||||
| 	return data.Characterspecies, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterSpecieByID(id uint64) (*pb.CharacterSpecie, error) { | ||||
| func (g *Client) GetCharacterSpecieByID(id uint64) (*pb.CharacterSpecie, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	characterSpecies, err := g.GetCharacterSpecies(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCharacterSpecieByID(id uint64) (*pb.CharacterSpecie, error) { | ||||
| 	return characterSpecies[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterSpeciesByIDs(ids []uint64) ([]*pb.CharacterSpecie, error) { | ||||
| func (g *Client) GetCharacterSpeciesByIDs(ids []uint64) ([]*pb.CharacterSpecie, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCharacterSpeciesByIDs(ids []uint64) ([]*pb.CharacterSpecie, er | ||||
| 	return g.GetCharacterSpecies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterSpeciesLength() (int, error) { | ||||
| func (g *Client) GetCharacterSpeciesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	characterSpecies, err := g.GetCharacterSpecies(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCharacters(query string) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharacters(query string) ([]*pb.Character, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/characters.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCharacters(query string) ([]*pb.Character, error) { | ||||
| 	return data.Characters, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharacterByID(id uint64) (*pb.Character, error) { | ||||
| func (g *Client) GetCharacterByID(id uint64) (*pb.Character, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	characters, err := g.GetCharacters(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCharacterByID(id uint64) (*pb.Character, error) { | ||||
| 	return characters[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCharactersByIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| 	return g.GetCharacters(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByCharacterGenderID(id uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByCharacterGenderID(id uint64) ([]*pb.Character, error) { | ||||
| 	query := fmt.Sprintf(`where character_gender = %d; fields *;`, id) | ||||
| 	return g.GetCharacters(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByCharacterGenderIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByCharacterGenderIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetCharactersByCharacterGenderIDs(ids []uint64) ([]*pb.Character, | ||||
| 	return g.GetCharacters(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByCharacterSpecieID(id uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByCharacterSpecieID(id uint64) ([]*pb.Character, error) { | ||||
| 	query := fmt.Sprintf(`where character_species = %d; fields *;`, id) | ||||
| 	return g.GetCharacters(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByCharacterSpecieIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByCharacterSpecieIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetCharactersByCharacterSpecieIDs(ids []uint64) ([]*pb.Character, | ||||
| 	return g.GetCharacters(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByMugShotID(id uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByMugShotID(id uint64) ([]*pb.Character, error) { | ||||
| 	query := fmt.Sprintf(`where mug_shot = %d; fields *;`, id) | ||||
| 	return g.GetCharacters(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersByMugShotIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| func (g *Client) GetCharactersByMugShotIDs(ids []uint64) ([]*pb.Character, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,7 +95,7 @@ func (g *igdb) GetCharactersByMugShotIDs(ids []uint64) ([]*pb.Character, error) | ||||
| 	return g.GetCharacters(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCharactersLength() (int, error) { | ||||
| func (g *Client) GetCharactersLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	characters, err := g.GetCharacters(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypes(query string) ([]*pb.CollectionMembershipType, error) { | ||||
| func (g *Client) GetCollectionMembershipTypes(query string) ([]*pb.CollectionMembershipType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collection_membership_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollectionMembershipTypes(query string) ([]*pb.CollectionMembe | ||||
| 	return data.Collectionmembershiptypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypeByID(id uint64) (*pb.CollectionMembershipType, error) { | ||||
| func (g *Client) GetCollectionMembershipTypeByID(id uint64) (*pb.CollectionMembershipType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collectionMembershipTypes, err := g.GetCollectionMembershipTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionMembershipTypeByID(id uint64) (*pb.CollectionMembers | ||||
| 	return collectionMembershipTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypesByIDs(ids []uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| func (g *Client) GetCollectionMembershipTypesByIDs(ids []uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCollectionMembershipTypesByIDs(ids []uint64) ([]*pb.Collection | ||||
| 	return g.GetCollectionMembershipTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypesByAllowedCollectionTypeID(id uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| func (g *Client) GetCollectionMembershipTypesByAllowedCollectionTypeID(id uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| 	query := fmt.Sprintf(`where allowed_collection_type = %d; fields *;`, id) | ||||
| 	return g.GetCollectionMembershipTypes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypesByAllowedCollectionTypeIDs(ids []uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| func (g *Client) GetCollectionMembershipTypesByAllowedCollectionTypeIDs(ids []uint64) ([]*pb.CollectionMembershipType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetCollectionMembershipTypesByAllowedCollectionTypeIDs(ids []uint | ||||
| 	return g.GetCollectionMembershipTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipTypesLength() (int, error) { | ||||
| func (g *Client) GetCollectionMembershipTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collectionMembershipTypes, err := g.GetCollectionMembershipTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollectionMemberships(query string) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMemberships(query string) ([]*pb.CollectionMembership, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collection_memberships.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollectionMemberships(query string) ([]*pb.CollectionMembershi | ||||
| 	return data.Collectionmemberships, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipByID(id uint64) (*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipByID(id uint64) (*pb.CollectionMembership, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collectionMemberships, err := g.GetCollectionMemberships(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionMembershipByID(id uint64) (*pb.CollectionMembership, | ||||
| 	return collectionMemberships[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCollectionMembershipsByIDs(ids []uint64) ([]*pb.CollectionMemb | ||||
| 	return g.GetCollectionMemberships(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByGameID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByGameID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetCollectionMemberships(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByGameIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByGameIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,17 +63,17 @@ func (g *igdb) GetCollectionMembershipsByGameIDs(ids []uint64) ([]*pb.Collection | ||||
| 	return g.GetCollectionMemberships(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByCollectionID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByCollectionID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	query := fmt.Sprintf(`where collection = %d; fields *;`, id) | ||||
| 	return g.GetCollectionMemberships(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByCollectionMembershipTypeID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByCollectionMembershipTypeID(id uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	query := fmt.Sprintf(`where type = %d; fields *;`, id) | ||||
| 	return g.GetCollectionMemberships(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsByCollectionMembershipTypeIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| func (g *Client) GetCollectionMembershipsByCollectionMembershipTypeIDs(ids []uint64) ([]*pb.CollectionMembership, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -84,7 +84,7 @@ func (g *igdb) GetCollectionMembershipsByCollectionMembershipTypeIDs(ids []uint6 | ||||
| 	return g.GetCollectionMemberships(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionMembershipsLength() (int, error) { | ||||
| func (g *Client) GetCollectionMembershipsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collectionMemberships, err := g.GetCollectionMemberships(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypes(query string) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypes(query string) ([]*pb.CollectionRelationType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collection_relation_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollectionRelationTypes(query string) ([]*pb.CollectionRelatio | ||||
| 	return data.Collectionrelationtypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypeByID(id uint64) (*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypeByID(id uint64) (*pb.CollectionRelationType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collectionRelationTypes, err := g.GetCollectionRelationTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionRelationTypeByID(id uint64) (*pb.CollectionRelationT | ||||
| 	return collectionRelationTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesByIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypesByIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCollectionRelationTypesByIDs(ids []uint64) ([]*pb.CollectionRe | ||||
| 	return g.GetCollectionRelationTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesByAllowedChildTypeID(id uint64) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypesByAllowedChildTypeID(id uint64) ([]*pb.CollectionRelationType, error) { | ||||
| 	query := fmt.Sprintf(`where allowed_child_type = %d; fields *;`, id) | ||||
| 	return g.GetCollectionRelationTypes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesByAllowedChildTypeIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypesByAllowedChildTypeIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetCollectionRelationTypesByAllowedChildTypeIDs(ids []uint64) ([] | ||||
| 	return g.GetCollectionRelationTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesByAllowedParentTypeID(id uint64) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypesByAllowedParentTypeID(id uint64) ([]*pb.CollectionRelationType, error) { | ||||
| 	query := fmt.Sprintf(`where allowed_parent_type = %d; fields *;`, id) | ||||
| 	return g.GetCollectionRelationTypes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesByAllowedParentTypeIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| func (g *Client) GetCollectionRelationTypesByAllowedParentTypeIDs(ids []uint64) ([]*pb.CollectionRelationType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetCollectionRelationTypesByAllowedParentTypeIDs(ids []uint64) ([ | ||||
| 	return g.GetCollectionRelationTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationTypesLength() (int, error) { | ||||
| func (g *Client) GetCollectionRelationTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collectionRelationTypes, err := g.GetCollectionRelationTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollectionRelations(query string) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelations(query string) ([]*pb.CollectionRelation, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collection_relations.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollectionRelations(query string) ([]*pb.CollectionRelation, e | ||||
| 	return data.Collectionrelations, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationByID(id uint64) (*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationByID(id uint64) (*pb.CollectionRelation, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collectionRelations, err := g.GetCollectionRelations(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionRelationByID(id uint64) (*pb.CollectionRelation, err | ||||
| 	return collectionRelations[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCollectionRelationsByIDs(ids []uint64) ([]*pb.CollectionRelati | ||||
| 	return g.GetCollectionRelations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByChildCollectionID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByChildCollectionID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	query := fmt.Sprintf(`where child_collection = %d; fields *;`, id) | ||||
| 	return g.GetCollectionRelations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByChildCollectionIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByChildCollectionIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetCollectionRelationsByChildCollectionIDs(ids []uint64) ([]*pb.C | ||||
| 	return g.GetCollectionRelations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByParentCollectionID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByParentCollectionID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	query := fmt.Sprintf(`where parent_collection = %d; fields *;`, id) | ||||
| 	return g.GetCollectionRelations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByParentCollectionIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByParentCollectionIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetCollectionRelationsByParentCollectionIDs(ids []uint64) ([]*pb. | ||||
| 	return g.GetCollectionRelations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByCollectionRelationTypeID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByCollectionRelationTypeID(id uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	query := fmt.Sprintf(`where type = %d; fields *;`, id) | ||||
| 	return g.GetCollectionRelations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsByCollectionRelationTypeIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| func (g *Client) GetCollectionRelationsByCollectionRelationTypeIDs(ids []uint64) ([]*pb.CollectionRelation, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,7 +95,7 @@ func (g *igdb) GetCollectionRelationsByCollectionRelationTypeIDs(ids []uint64) ( | ||||
| 	return g.GetCollectionRelations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionRelationsLength() (int, error) { | ||||
| func (g *Client) GetCollectionRelationsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collectionRelations, err := g.GetCollectionRelations(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollectionTypes(query string) ([]*pb.CollectionType, error) { | ||||
| func (g *Client) GetCollectionTypes(query string) ([]*pb.CollectionType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collection_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollectionTypes(query string) ([]*pb.CollectionType, error) { | ||||
| 	return data.Collectiontypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionTypeByID(id uint64) (*pb.CollectionType, error) { | ||||
| func (g *Client) GetCollectionTypeByID(id uint64) (*pb.CollectionType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collectionTypes, err := g.GetCollectionTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionTypeByID(id uint64) (*pb.CollectionType, error) { | ||||
| 	return collectionTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionTypesByIDs(ids []uint64) ([]*pb.CollectionType, error) { | ||||
| func (g *Client) GetCollectionTypesByIDs(ids []uint64) ([]*pb.CollectionType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCollectionTypesByIDs(ids []uint64) ([]*pb.CollectionType, erro | ||||
| 	return g.GetCollectionTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionTypesLength() (int, error) { | ||||
| func (g *Client) GetCollectionTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collectionTypes, err := g.GetCollectionTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCollections(query string) ([]*pb.Collection, error) { | ||||
| func (g *Client) GetCollections(query string) ([]*pb.Collection, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/collections.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCollections(query string) ([]*pb.Collection, error) { | ||||
| 	return data.Collections, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionByID(id uint64) (*pb.Collection, error) { | ||||
| func (g *Client) GetCollectionByID(id uint64) (*pb.Collection, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	collections, err := g.GetCollections(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCollectionByID(id uint64) (*pb.Collection, error) { | ||||
| 	return collections[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionsByIDs(ids []uint64) ([]*pb.Collection, error) { | ||||
| func (g *Client) GetCollectionsByIDs(ids []uint64) ([]*pb.Collection, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCollectionsByIDs(ids []uint64) ([]*pb.Collection, error) { | ||||
| 	return g.GetCollections(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionsByCollectionTypeID(id uint64) ([]*pb.Collection, error) { | ||||
| func (g *Client) GetCollectionsByCollectionTypeID(id uint64) ([]*pb.Collection, error) { | ||||
| 	query := fmt.Sprintf(`where collection_type = %d; fields *;`, id) | ||||
| 	return g.GetCollections(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionsByCollectionTypeIDs(ids []uint64) ([]*pb.Collection, error) { | ||||
| func (g *Client) GetCollectionsByCollectionTypeIDs(ids []uint64) ([]*pb.Collection, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetCollectionsByCollectionTypeIDs(ids []uint64) ([]*pb.Collection | ||||
| 	return g.GetCollections(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCollectionsLength() (int, error) { | ||||
| func (g *Client) GetCollectionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	collections, err := g.GetCollections(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										32
									
								
								companies.go
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								companies.go
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCompanies(query string) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanies(query string) ([]*pb.Company, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/companies.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -28,7 +28,7 @@ func (g *igdb) GetCompanies(query string) ([]*pb.Company, error) { | ||||
| 	return data.Companies, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByID(id uint64) (*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByID(id uint64) (*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	companys, err := g.GetCompanies(query) | ||||
| 	if err != nil { | ||||
| @@ -37,7 +37,7 @@ func (g *igdb) GetCompanyByID(id uint64) (*pb.Company, error) { | ||||
| 	return companys[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -48,12 +48,12 @@ func (g *igdb) GetCompanyByIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByChangeDateFormatID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByChangeDateFormatID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where change_date_format = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByChangeDateFormatsIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByChangeDateFormatsIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -64,12 +64,12 @@ func (g *igdb) GetCompanyByChangeDateFormatsIDs(ids []uint64) ([]*pb.Company, er | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByChangedCompanyID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByChangedCompanyID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where changed_company_id = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByChangedCompanyIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByChangedCompanyIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -80,12 +80,12 @@ func (g *igdb) GetCompanyByChangedCompanyIDs(ids []uint64) ([]*pb.Company, error | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByLogoID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByLogoID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where logo = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByLogoIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByLogoIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -96,12 +96,12 @@ func (g *igdb) GetCompanyByLogoIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByParentID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByParentID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where parent = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByParentIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByParentIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -112,12 +112,12 @@ func (g *igdb) GetCompanyByParentIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByStartDateFormatID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByStartDateFormatID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where start_date_format = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByStartDateFormatsIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByStartDateFormatsIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -128,12 +128,12 @@ func (g *igdb) GetCompanyByStartDateFormatsIDs(ids []uint64) ([]*pb.Company, err | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByStatusID(id uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByStatusID(id uint64) ([]*pb.Company, error) { | ||||
| 	query := fmt.Sprintf(`where status = %d; fields *;`, id) | ||||
| 	return g.GetCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyByStatusIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| func (g *Client) GetCompanyByStatusIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -144,7 +144,7 @@ func (g *igdb) GetCompanyByStatusIDs(ids []uint64) ([]*pb.Company, error) { | ||||
| 	return g.GetCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompaniesLength() (int, error) { | ||||
| func (g *Client) GetCompaniesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	companies, err := g.GetCompanies(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCompanyLogos(query string) ([]*pb.CompanyLogo, error) { | ||||
| func (g *Client) GetCompanyLogos(query string) ([]*pb.CompanyLogo, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/company_logos.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCompanyLogos(query string) ([]*pb.CompanyLogo, error) { | ||||
| 	return data.Companylogos, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyLogoByID(id uint64) (*pb.CompanyLogo, error) { | ||||
| func (g *Client) GetCompanyLogoByID(id uint64) (*pb.CompanyLogo, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	companyLogos, err := g.GetCompanyLogos(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCompanyLogoByID(id uint64) (*pb.CompanyLogo, error) { | ||||
| 	return companyLogos[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyLogosByIDs(ids []uint64) ([]*pb.CompanyLogo, error) { | ||||
| func (g *Client) GetCompanyLogosByIDs(ids []uint64) ([]*pb.CompanyLogo, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCompanyLogosByIDs(ids []uint64) ([]*pb.CompanyLogo, error) { | ||||
| 	return g.GetCompanyLogos(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyLogosLength() (int, error) { | ||||
| func (g *Client) GetCompanyLogosLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	companyLogos, err := g.GetCompanyLogos(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCompanyStatuses(query string) ([]*pb.CompanyStatus, error) { | ||||
| func (g *Client) GetCompanyStatuses(query string) ([]*pb.CompanyStatus, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/company_statuses.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCompanyStatuses(query string) ([]*pb.CompanyStatus, error) { | ||||
| 	return data.Companystatuses, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyStatusByID(id uint64) (*pb.CompanyStatus, error) { | ||||
| func (g *Client) GetCompanyStatusByID(id uint64) (*pb.CompanyStatus, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	companyStatuses, err := g.GetCompanyStatuses(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCompanyStatusByID(id uint64) (*pb.CompanyStatus, error) { | ||||
| 	return companyStatuses[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyStatusesByIDs(ids []uint64) ([]*pb.CompanyStatus, error) { | ||||
| func (g *Client) GetCompanyStatusesByIDs(ids []uint64) ([]*pb.CompanyStatus, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetCompanyStatusesByIDs(ids []uint64) ([]*pb.CompanyStatus, error | ||||
| 	return g.GetCompanyStatuses(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyStatusesLength() (int, error) { | ||||
| func (g *Client) GetCompanyStatusesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	companyStatuses, err := g.GetCompanyStatuses(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsites(query string) ([]*pb.CompanyWebsite, error) { | ||||
| func (g *Client) GetCompanyWebsites(query string) ([]*pb.CompanyWebsite, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/company_websites.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCompanyWebsites(query string) ([]*pb.CompanyWebsite, error) { | ||||
| 	return data.Companywebsites, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsiteByID(id uint64) (*pb.CompanyWebsite, error) { | ||||
| func (g *Client) GetCompanyWebsiteByID(id uint64) (*pb.CompanyWebsite, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	companyWebsites, err := g.GetCompanyWebsites(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCompanyWebsiteByID(id uint64) (*pb.CompanyWebsite, error) { | ||||
| 	return companyWebsites[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsitesByIDs(ids []uint64) ([]*pb.CompanyWebsite, error) { | ||||
| func (g *Client) GetCompanyWebsitesByIDs(ids []uint64) ([]*pb.CompanyWebsite, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCompanyWebsitesByIDs(ids []uint64) ([]*pb.CompanyWebsite, erro | ||||
| 	return g.GetCompanyWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsitesByTypeID(id uint64) ([]*pb.CompanyWebsite, error) { | ||||
| func (g *Client) GetCompanyWebsitesByTypeID(id uint64) ([]*pb.CompanyWebsite, error) { | ||||
| 	query := fmt.Sprintf(`where type = %d; fields *;`, id) | ||||
| 	return g.GetCompanyWebsites(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsitesByTypeIDs(ids []uint64) ([]*pb.CompanyWebsite, error) { | ||||
| func (g *Client) GetCompanyWebsitesByTypeIDs(ids []uint64) ([]*pb.CompanyWebsite, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetCompanyWebsitesByTypeIDs(ids []uint64) ([]*pb.CompanyWebsite, | ||||
| 	return g.GetCompanyWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCompanyWebsitesLength() (int, error) { | ||||
| func (g *Client) GetCompanyWebsitesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	companyWebsites, err := g.GetCompanyWebsites(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										16
									
								
								covers.go
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								covers.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetCovers(query string) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCovers(query string) ([]*pb.Cover, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/covers.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetCovers(query string) ([]*pb.Cover, error) { | ||||
| 	return data.Covers, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoverByID(id uint64) (*pb.Cover, error) { | ||||
| func (g *Client) GetCoverByID(id uint64) (*pb.Cover, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	covers, err := g.GetCovers(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetCoverByID(id uint64) (*pb.Cover, error) { | ||||
| 	return covers[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversByIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCoversByIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetCoversByIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| 	return g.GetCovers(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversByGameID(id uint64) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCoversByGameID(id uint64) ([]*pb.Cover, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetCovers(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversByGameIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCoversByGameIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetCoversByGameIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| 	return g.GetCovers(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversByGameLocalizationID(id uint64) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCoversByGameLocalizationID(id uint64) ([]*pb.Cover, error) { | ||||
| 	query := fmt.Sprintf(`where game_localization = %d; fields *;`, id) | ||||
| 	return g.GetCovers(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversByGameLocalizationIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| func (g *Client) GetCoversByGameLocalizationIDs(ids []uint64) ([]*pb.Cover, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetCoversByGameLocalizationIDs(ids []uint64) ([]*pb.Cover, error) | ||||
| 	return g.GetCovers(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetCoversLength() (int, error) { | ||||
| func (g *Client) GetCoversLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	covers, err := g.GetCovers(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetDateFormats(query string) ([]*pb.DateFormat, error) { | ||||
| func (g *Client) GetDateFormats(query string) ([]*pb.DateFormat, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/date_formats.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetDateFormats(query string) ([]*pb.DateFormat, error) { | ||||
| 	return data.Dateformats, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetDateFormatByID(id uint64) (*pb.DateFormat, error) { | ||||
| func (g *Client) GetDateFormatByID(id uint64) (*pb.DateFormat, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	dateFormats, err := g.GetDateFormats(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetDateFormatByID(id uint64) (*pb.DateFormat, error) { | ||||
| 	return dateFormats[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetDateFormatsByIDs(ids []uint64) ([]*pb.DateFormat, error) { | ||||
| func (g *Client) GetDateFormatsByIDs(ids []uint64) ([]*pb.DateFormat, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetDateFormatsByIDs(ids []uint64) ([]*pb.DateFormat, error) { | ||||
| 	return g.GetDateFormats(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetDateFormatsLength() (int, error) { | ||||
| func (g *Client) GetDateFormatsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	dateFormats, err := g.GetDateFormats(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetEventNetworks(query string) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworks(query string) ([]*pb.EventNetwork, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/event_networks.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetEventNetworks(query string) ([]*pb.EventNetwork, error) { | ||||
| 	return data.Eventnetworks, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworkByID(id uint64) (*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworkByID(id uint64) (*pb.EventNetwork, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	eventNetworks, err := g.GetEventNetworks(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetEventNetworkByID(id uint64) (*pb.EventNetwork, error) { | ||||
| 	return eventNetworks[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksByIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworksByIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetEventNetworksByIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| 	return g.GetEventNetworks(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksByEventID(id uint64) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworksByEventID(id uint64) ([]*pb.EventNetwork, error) { | ||||
| 	query := fmt.Sprintf(`where event = %d; fields *;`, id) | ||||
| 	return g.GetEventNetworks(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksByEventIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworksByEventIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetEventNetworksByEventIDs(ids []uint64) ([]*pb.EventNetwork, err | ||||
| 	return g.GetEventNetworks(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksByNetworkTypeID(id uint64) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworksByNetworkTypeID(id uint64) ([]*pb.EventNetwork, error) { | ||||
| 	query := fmt.Sprintf(`where network_type = %d; fields *;`, id) | ||||
| 	return g.GetEventNetworks(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksByNetworkTypeIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| func (g *Client) GetEventNetworksByNetworkTypeIDs(ids []uint64) ([]*pb.EventNetwork, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetEventNetworksByNetworkTypeIDs(ids []uint64) ([]*pb.EventNetwor | ||||
| 	return g.GetEventNetworks(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventNetworksLength() (int, error) { | ||||
| func (g *Client) GetEventNetworksLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	eventNetworks, err := g.GetEventNetworks(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										12
									
								
								events.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								events.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetEvents(query string) ([]*pb.Event, error) { | ||||
| func (g *Client) GetEvents(query string) ([]*pb.Event, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/events.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetEvents(query string) ([]*pb.Event, error) { | ||||
| 	return data.Events, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventByID(id uint64) (*pb.Event, error) { | ||||
| func (g *Client) GetEventByID(id uint64) (*pb.Event, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	events, err := g.GetEvents(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetEventByID(id uint64) (*pb.Event, error) { | ||||
| 	return events[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventsByIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| func (g *Client) GetEventsByIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetEventsByIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| 	return g.GetEvents(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventsByEventLogoID(id uint64) ([]*pb.Event, error) { | ||||
| func (g *Client) GetEventsByEventLogoID(id uint64) ([]*pb.Event, error) { | ||||
| 	query := fmt.Sprintf(`where event_logo = %d; fields *;`, id) | ||||
| 	return g.GetEvents(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventsByEventLogoIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| func (g *Client) GetEventsByEventLogoIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetEventsByEventLogoIDs(ids []uint64) ([]*pb.Event, error) { | ||||
| 	return g.GetEvents(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetEventsLength() (int, error) { | ||||
| func (g *Client) GetEventsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	events, err := g.GetEvents(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetExternalGameSources(query string) ([]*pb.ExternalGameSource, error) { | ||||
| func (g *Client) GetExternalGameSources(query string) ([]*pb.ExternalGameSource, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/external_game_sources.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetExternalGameSources(query string) ([]*pb.ExternalGameSource, e | ||||
| 	return data.Externalgamesources, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGameSourceByID(id uint64) (*pb.ExternalGameSource, error) { | ||||
| func (g *Client) GetExternalGameSourceByID(id uint64) (*pb.ExternalGameSource, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	externalGameSources, err := g.GetExternalGameSources(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetExternalGameSourceByID(id uint64) (*pb.ExternalGameSource, err | ||||
| 	return externalGameSources[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGameSourcesByIDs(ids []uint64) ([]*pb.ExternalGameSource, error) { | ||||
| func (g *Client) GetExternalGameSourcesByIDs(ids []uint64) ([]*pb.ExternalGameSource, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetExternalGameSourcesByIDs(ids []uint64) ([]*pb.ExternalGameSour | ||||
| 	return g.GetExternalGameSources(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGameSourcesLength() (int, error) { | ||||
| func (g *Client) GetExternalGameSourcesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	externalGameSources, err := g.GetExternalGameSources(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetExternalGames(query string) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGames(query string) ([]*pb.ExternalGame, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/external_games.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -28,7 +28,7 @@ func (g *igdb) GetExternalGames(query string) ([]*pb.ExternalGame, error) { | ||||
| 	return data.Externalgames, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGameByID(id uint64) (*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGameByID(id uint64) (*pb.ExternalGame, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	externalGames, err := g.GetExternalGames(query) | ||||
| 	if err != nil { | ||||
| @@ -37,7 +37,7 @@ func (g *igdb) GetExternalGameByID(id uint64) (*pb.ExternalGame, error) { | ||||
| 	return externalGames[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -48,7 +48,7 @@ func (g *igdb) GetExternalGamesByIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| 	return g.GetExternalGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameIDBySteamAppID(id uint64) (uint64, error) { | ||||
| func (g *Client) GetGameIDBySteamAppID(id uint64) (uint64, error) { | ||||
| 	query := fmt.Sprintf(`where game_type.id = 0 & uid = "%d"; fields game;`, id) | ||||
| 	externalGames, err := g.GetExternalGames(query) | ||||
| 	if err != nil { | ||||
| @@ -57,7 +57,7 @@ func (g *igdb) GetGameIDBySteamAppID(id uint64) (uint64, error) { | ||||
| 	return externalGames[0].Game.Id, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetSteamIDByGameID(id uint64) (uint64, error) { | ||||
| func (g *Client) GetSteamIDByGameID(id uint64) (uint64, error) { | ||||
| 	query := fmt.Sprintf(`where game = %v & game_type.id = 0; fields *;`, id) | ||||
| 	externalGames, err := g.GetExternalGames(query) | ||||
| 	if err != nil { | ||||
| @@ -66,17 +66,17 @@ func (g *igdb) GetSteamIDByGameID(id uint64) (uint64, error) { | ||||
| 	return strconv.ParseUint(externalGames[0].Uid, 10, 64) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByGameID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByGameID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetExternalGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByExternalGameSourceID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByExternalGameSourceID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| 	query := fmt.Sprintf(`where external_game_source = %d; fields *;`, id) | ||||
| 	return g.GetExternalGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByExternalGameSourceIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByExternalGameSourceIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -87,12 +87,12 @@ func (g *igdb) GetExternalGamesByExternalGameSourceIDs(ids []uint64) ([]*pb.Exte | ||||
| 	return g.GetExternalGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByGameReleaseFormatID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByGameReleaseFormatID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| 	query := fmt.Sprintf(`where game_release_format = %d; fields *;`, id) | ||||
| 	return g.GetExternalGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByGameReleaseFormatIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByGameReleaseFormatIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -103,12 +103,12 @@ func (g *igdb) GetExternalGamesByGameReleaseFormatIDs(ids []uint64) ([]*pb.Exter | ||||
| 	return g.GetExternalGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByPlatformVersionID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByPlatformVersionID(id uint64) ([]*pb.ExternalGame, error) { | ||||
| 	query := fmt.Sprintf(`where platform_version = %d; fields *;`, id) | ||||
| 	return g.GetExternalGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesByPlatformVersionIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| func (g *Client) GetExternalGamesByPlatformVersionIDs(ids []uint64) ([]*pb.ExternalGame, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -119,7 +119,7 @@ func (g *igdb) GetExternalGamesByPlatformVersionIDs(ids []uint64) ([]*pb.Externa | ||||
| 	return g.GetExternalGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetExternalGamesLength() (int, error) { | ||||
| func (g *Client) GetExternalGamesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	externalGames, err := g.GetExternalGames(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetFranchises(query string) ([]*pb.Franchise, error) { | ||||
| func (g *Client) GetFranchises(query string) ([]*pb.Franchise, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/franchises.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetFranchises(query string) ([]*pb.Franchise, error) { | ||||
| 	return data.Franchises, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetFranchiseByID(id uint64) (*pb.Franchise, error) { | ||||
| func (g *Client) GetFranchiseByID(id uint64) (*pb.Franchise, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	franchises, err := g.GetFranchises(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetFranchiseByID(id uint64) (*pb.Franchise, error) { | ||||
| 	return franchises[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetFranchisesByIDs(ids []uint64) ([]*pb.Franchise, error) { | ||||
| func (g *Client) GetFranchisesByIDs(ids []uint64) ([]*pb.Franchise, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetFranchisesByIDs(ids []uint64) ([]*pb.Franchise, error) { | ||||
| 	return g.GetFranchises(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetFranchisesLength() (int, error) { | ||||
| func (g *Client) GetFranchisesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	franchises, err := g.GetFranchises(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameEngineLogos(query string) ([]*pb.GameEngineLogo, error) { | ||||
| func (g *Client) GetGameEngineLogos(query string) ([]*pb.GameEngineLogo, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_engine_logos.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameEngineLogos(query string) ([]*pb.GameEngineLogo, error) { | ||||
| 	return data.Gameenginelogos, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEngineLogoByID(id uint64) (*pb.GameEngineLogo, error) { | ||||
| func (g *Client) GetGameEngineLogoByID(id uint64) (*pb.GameEngineLogo, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameEngineLogos, err := g.GetGameEngineLogos(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameEngineLogoByID(id uint64) (*pb.GameEngineLogo, error) { | ||||
| 	return gameEngineLogos[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEngineLogosByIDs(ids []uint64) ([]*pb.GameEngineLogo, error) { | ||||
| func (g *Client) GetGameEngineLogosByIDs(ids []uint64) ([]*pb.GameEngineLogo, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameEngineLogosByIDs(ids []uint64) ([]*pb.GameEngineLogo, erro | ||||
| 	return g.GetGameEngineLogos(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEngineLogosLength() (int, error) { | ||||
| func (g *Client) GetGameEngineLogosLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameEngineLogos, err := g.GetGameEngineLogos(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameEngines(query string) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEngines(query string) ([]*pb.GameEngine, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_engines.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameEngines(query string) ([]*pb.GameEngine, error) { | ||||
| 	return data.Gameengines, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEngineByID(id uint64) (*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEngineByID(id uint64) (*pb.GameEngine, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameEngines, err := g.GetGameEngines(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameEngineByID(id uint64) (*pb.GameEngine, error) { | ||||
| 	return gameEngines[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesByIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEnginesByIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameEnginesByIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	return g.GetGameEngines(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesByGameID(id uint64) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEnginesByGameID(id uint64) ([]*pb.GameEngine, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetGameEngines(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesByGameIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEnginesByGameIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetGameEnginesByGameIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	return g.GetGameEngines(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesByLogoID(id uint64) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEnginesByLogoID(id uint64) ([]*pb.GameEngine, error) { | ||||
| 	query := fmt.Sprintf(`where logo = %d; fields *;`, id) | ||||
| 	return g.GetGameEngines(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesByLogoIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| func (g *Client) GetGameEnginesByLogoIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetGameEnginesByLogoIDs(ids []uint64) ([]*pb.GameEngine, error) { | ||||
| 	return g.GetGameEngines(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameEnginesLength() (int, error) { | ||||
| func (g *Client) GetGameEnginesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameEngines, err := g.GetGameEngines(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameLocalizations(query string) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizations(query string) ([]*pb.GameLocalization, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_localizations.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameLocalizations(query string) ([]*pb.GameLocalization, error | ||||
| 	return data.Gamelocalizations, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationByID(id uint64) (*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationByID(id uint64) (*pb.GameLocalization, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameLocalizations, err := g.GetGameLocalizations(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameLocalizationByID(id uint64) (*pb.GameLocalization, error) | ||||
| 	return gameLocalizations[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameLocalizationsByIDs(ids []uint64) ([]*pb.GameLocalization, | ||||
| 	return g.GetGameLocalizations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByGameID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByGameID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetGameLocalizations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByGameIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByGameIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetGameLocalizationsByGameIDs(ids []uint64) ([]*pb.GameLocalizati | ||||
| 	return g.GetGameLocalizations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByCoverID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByCoverID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| 	query := fmt.Sprintf(`where cover = %d; fields *;`, id) | ||||
| 	return g.GetGameLocalizations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByCoverIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByCoverIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetGameLocalizationsByCoverIDs(ids []uint64) ([]*pb.GameLocalizat | ||||
| 	return g.GetGameLocalizations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByRegionID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByRegionID(id uint64) ([]*pb.GameLocalization, error) { | ||||
| 	query := fmt.Sprintf(`where region = %d; fields *;`, id) | ||||
| 	return g.GetGameLocalizations(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsByRegionIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| func (g *Client) GetGameLocalizationsByRegionIDs(ids []uint64) ([]*pb.GameLocalization, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,7 +95,7 @@ func (g *igdb) GetGameLocalizationsByRegionIDs(ids []uint64) ([]*pb.GameLocaliza | ||||
| 	return g.GetGameLocalizations(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameLocalizationsLength() (int, error) { | ||||
| func (g *Client) GetGameLocalizationsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameLocalizations, err := g.GetGameLocalizations(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameModes(query string) ([]*pb.GameMode, error) { | ||||
| func (g *Client) GetGameModes(query string) ([]*pb.GameMode, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_modes.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameModes(query string) ([]*pb.GameMode, error) { | ||||
| 	return data.Gamemodes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameModeByID(id uint64) (*pb.GameMode, error) { | ||||
| func (g *Client) GetGameModeByID(id uint64) (*pb.GameMode, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameModes, err := g.GetGameModes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameModeByID(id uint64) (*pb.GameMode, error) { | ||||
| 	return gameModes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameModesByIDs(ids []uint64) ([]*pb.GameMode, error) { | ||||
| func (g *Client) GetGameModesByIDs(ids []uint64) ([]*pb.GameMode, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameModesByIDs(ids []uint64) ([]*pb.GameMode, error) { | ||||
| 	return g.GetGameModes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameModesLength() (int, error) { | ||||
| func (g *Client) GetGameModesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameModes, err := g.GetGameModes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameReleaseFormats(query string) ([]*pb.GameReleaseFormat, error) { | ||||
| func (g *Client) GetGameReleaseFormats(query string) ([]*pb.GameReleaseFormat, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_release_formats.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameReleaseFormats(query string) ([]*pb.GameReleaseFormat, err | ||||
| 	return data.Gamereleaseformats, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameReleaseFormatByID(id uint64) (*pb.GameReleaseFormat, error) { | ||||
| func (g *Client) GetGameReleaseFormatByID(id uint64) (*pb.GameReleaseFormat, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameReleaseFormats, err := g.GetGameReleaseFormats(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameReleaseFormatByID(id uint64) (*pb.GameReleaseFormat, error | ||||
| 	return gameReleaseFormats[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameReleaseFormatsByIDs(ids []uint64) ([]*pb.GameReleaseFormat, error) { | ||||
| func (g *Client) GetGameReleaseFormatsByIDs(ids []uint64) ([]*pb.GameReleaseFormat, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameReleaseFormatsByIDs(ids []uint64) ([]*pb.GameReleaseFormat | ||||
| 	return g.GetGameReleaseFormats(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameReleaseFormatsLength() (int, error) { | ||||
| func (g *Client) GetGameReleaseFormatsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameReleaseFormats, err := g.GetGameReleaseFormats(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameStatuses(query string) ([]*pb.GameStatus, error) { | ||||
| func (g *Client) GetGameStatuses(query string) ([]*pb.GameStatus, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_statuses.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameStatuses(query string) ([]*pb.GameStatus, error) { | ||||
| 	return data.Gamestatuses, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameStatusByID(id uint64) (*pb.GameStatus, error) { | ||||
| func (g *Client) GetGameStatusByID(id uint64) (*pb.GameStatus, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameStatuses, err := g.GetGameStatuses(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameStatusByID(id uint64) (*pb.GameStatus, error) { | ||||
| 	return gameStatuses[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameStatusesByIDs(ids []uint64) ([]*pb.GameStatus, error) { | ||||
| func (g *Client) GetGameStatusesByIDs(ids []uint64) ([]*pb.GameStatus, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameStatusesByIDs(ids []uint64) ([]*pb.GameStatus, error) { | ||||
| 	return g.GetGameStatuses(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameStatusesLength() (int, error) { | ||||
| func (g *Client) GetGameStatusesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameStatuses, err := g.GetGameStatuses(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeats(query string) ([]*pb.GameTimeToBeat, error) { | ||||
| func (g *Client) GetGameTimeToBeats(query string) ([]*pb.GameTimeToBeat, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_time_to_beats.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameTimeToBeats(query string) ([]*pb.GameTimeToBeat, error) { | ||||
| 	return data.Gametimetobeats, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeatByID(id uint64) (*pb.GameTimeToBeat, error) { | ||||
| func (g *Client) GetGameTimeToBeatByID(id uint64) (*pb.GameTimeToBeat, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameTimeToBeats, err := g.GetGameTimeToBeats(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameTimeToBeatByID(id uint64) (*pb.GameTimeToBeat, error) { | ||||
| 	return gameTimeToBeats[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeatsByIDs(ids []uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| func (g *Client) GetGameTimeToBeatsByIDs(ids []uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameTimeToBeatsByIDs(ids []uint64) ([]*pb.GameTimeToBeat, erro | ||||
| 	return g.GetGameTimeToBeats(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeatsByGameID(id uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| func (g *Client) GetGameTimeToBeatsByGameID(id uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetGameTimeToBeats(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeatsByGameIDs(ids []uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| func (g *Client) GetGameTimeToBeatsByGameIDs(ids []uint64) ([]*pb.GameTimeToBeat, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetGameTimeToBeatsByGameIDs(ids []uint64) ([]*pb.GameTimeToBeat, | ||||
| 	return g.GetGameTimeToBeats(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTimeToBeatsLength() (int, error) { | ||||
| func (g *Client) GetGameTimeToBeatsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameTimeToBeats, err := g.GetGameTimeToBeats(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameTypes(query string) ([]*pb.GameType, error) { | ||||
| func (g *Client) GetGameTypes(query string) ([]*pb.GameType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameTypes(query string) ([]*pb.GameType, error) { | ||||
| 	return data.Gametypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTypeByID(id uint64) (*pb.GameType, error) { | ||||
| func (g *Client) GetGameTypeByID(id uint64) (*pb.GameType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameTypes, err := g.GetGameTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameTypeByID(id uint64) (*pb.GameType, error) { | ||||
| 	return gameTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTypesByIDs(ids []uint64) ([]*pb.GameType, error) { | ||||
| func (g *Client) GetGameTypesByIDs(ids []uint64) ([]*pb.GameType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameTypesByIDs(ids []uint64) ([]*pb.GameType, error) { | ||||
| 	return g.GetGameTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameTypesLength() (int, error) { | ||||
| func (g *Client) GetGameTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameTypes, err := g.GetGameTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameVersionFeatures(query string) ([]*pb.GameVersionFeature, error) { | ||||
| func (g *Client) GetGameVersionFeatures(query string) ([]*pb.GameVersionFeature, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_version_features.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameVersionFeatures(query string) ([]*pb.GameVersionFeature, e | ||||
| 	return data.Gameversionfeatures, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionFeatureByID(id uint64) (*pb.GameVersionFeature, error) { | ||||
| func (g *Client) GetGameVersionFeatureByID(id uint64) (*pb.GameVersionFeature, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameVersionFeatures, err := g.GetGameVersionFeatures(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameVersionFeatureByID(id uint64) (*pb.GameVersionFeature, err | ||||
| 	return gameVersionFeatures[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionFeaturesByIDs(ids []uint64) ([]*pb.GameVersionFeature, error) { | ||||
| func (g *Client) GetGameVersionFeaturesByIDs(ids []uint64) ([]*pb.GameVersionFeature, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGameVersionFeaturesByIDs(ids []uint64) ([]*pb.GameVersionFeatu | ||||
| 	return g.GetGameVersionFeatures(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionFeaturesLength() (int, error) { | ||||
| func (g *Client) GetGameVersionFeaturesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameVersionFeatures, err := g.GetGameVersionFeatures(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameVersions(query string) ([]*pb.GameVersion, error) { | ||||
| func (g *Client) GetGameVersions(query string) ([]*pb.GameVersion, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_versions.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameVersions(query string) ([]*pb.GameVersion, error) { | ||||
| 	return data.Gameversions, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionByID(id uint64) (*pb.GameVersion, error) { | ||||
| func (g *Client) GetGameVersionByID(id uint64) (*pb.GameVersion, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameVersions, err := g.GetGameVersions(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameVersionByID(id uint64) (*pb.GameVersion, error) { | ||||
| 	return gameVersions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionsByIDs(ids []uint64) ([]*pb.GameVersion, error) { | ||||
| func (g *Client) GetGameVersionsByIDs(ids []uint64) ([]*pb.GameVersion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameVersionsByIDs(ids []uint64) ([]*pb.GameVersion, error) { | ||||
| 	return g.GetGameVersions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionsByGameID(id uint64) ([]*pb.GameVersion, error) { | ||||
| func (g *Client) GetGameVersionsByGameID(id uint64) ([]*pb.GameVersion, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetGameVersions(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionsByGameIDs(ids []uint64) ([]*pb.GameVersion, error) { | ||||
| func (g *Client) GetGameVersionsByGameIDs(ids []uint64) ([]*pb.GameVersion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetGameVersionsByGameIDs(ids []uint64) ([]*pb.GameVersion, error) | ||||
| 	return g.GetGameVersions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVersionsLength() (int, error) { | ||||
| func (g *Client) GetGameVersionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameVersions, err := g.GetGameVersions(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGameVideos(query string) ([]*pb.GameVideo, error) { | ||||
| func (g *Client) GetGameVideos(query string) ([]*pb.GameVideo, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/game_videos.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGameVideos(query string) ([]*pb.GameVideo, error) { | ||||
| 	return data.Gamevideos, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVideoByID(id uint64) (*pb.GameVideo, error) { | ||||
| func (g *Client) GetGameVideoByID(id uint64) (*pb.GameVideo, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	gameVideos, err := g.GetGameVideos(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameVideoByID(id uint64) (*pb.GameVideo, error) { | ||||
| 	return gameVideos[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVideosByIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| func (g *Client) GetGameVideosByIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameVideosByIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| 	return g.GetGameVideos(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVideosByGameID(id uint64) ([]*pb.GameVideo, error) { | ||||
| func (g *Client) GetGameVideosByGameID(id uint64) ([]*pb.GameVideo, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetGameVideos(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVideosByGameIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| func (g *Client) GetGameVideosByGameIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetGameVideosByGameIDs(ids []uint64) ([]*pb.GameVideo, error) { | ||||
| 	return g.GetGameVideos(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameVideosLength() (int, error) { | ||||
| func (g *Client) GetGameVideosLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	gameVideos, err := g.GetGameVideos(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										36
									
								
								games.go
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								games.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGames(query string) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGames(query string) ([]*pb.Game, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/games.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGames(query string) ([]*pb.Game, error) { | ||||
| 	return data.Games, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByID(id uint64) (*pb.Game, error) { | ||||
| func (g *Client) GetGameByID(id uint64) (*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	games, err := g.GetGames(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGameByID(id uint64) (*pb.Game, error) { | ||||
| 	return games[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetGameByIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByCollectionID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByCollectionID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where collection = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByCollectionIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByCollectionIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetGamesByCollectionIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByCoverID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByCoverID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where cover = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByCoverIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByCoverIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetGamesByCoverIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByFranchiseID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByFranchiseID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where franchise = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByFranchiseIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByFranchiseIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,12 +95,12 @@ func (g *igdb) GetGamesByFranchiseIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByGameStatusID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByGameStatusID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where game_status = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByGameStatusIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByGameStatusIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -111,12 +111,12 @@ func (g *igdb) GetGamesByGameStatusIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByGameTypeID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByGameTypeID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where game_type = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByGameTypeIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByGameTypeIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -127,12 +127,12 @@ func (g *igdb) GetGamesByGameTypeIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByParentGameID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByParentGameID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where parent_game = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByParentGameIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByParentGameIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -143,12 +143,12 @@ func (g *igdb) GetGamesByParentGameIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGameByVersionParentGameID(id uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGameByVersionParentGameID(id uint64) ([]*pb.Game, error) { | ||||
| 	query := fmt.Sprintf(`where version_parent = %d; fields *;`, id) | ||||
| 	return g.GetGames(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesByVersionParentGameIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| func (g *Client) GetGamesByVersionParentGameIDs(ids []uint64) ([]*pb.Game, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -159,7 +159,7 @@ func (g *igdb) GetGamesByVersionParentGameIDs(ids []uint64) ([]*pb.Game, error) | ||||
| 	return g.GetGames(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGamesLength() (int, error) { | ||||
| func (g *Client) GetGamesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	games, err := g.GetGames(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetGenres(query string) ([]*pb.Genre, error) { | ||||
| func (g *Client) GetGenres(query string) ([]*pb.Genre, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/genres.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetGenres(query string) ([]*pb.Genre, error) { | ||||
| 	return data.Genres, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGenreByID(id uint64) (*pb.Genre, error) { | ||||
| func (g *Client) GetGenreByID(id uint64) (*pb.Genre, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	genres, err := g.GetGenres(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetGenreByID(id uint64) (*pb.Genre, error) { | ||||
| 	return genres[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGenresByIDs(ids []uint64) ([]*pb.Genre, error) { | ||||
| func (g *Client) GetGenresByIDs(ids []uint64) ([]*pb.Genre, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetGenresByIDs(ids []uint64) ([]*pb.Genre, error) { | ||||
| 	return g.GetGenres(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetGenresLength() (int, error) { | ||||
| func (g *Client) GetGenresLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	genres, err := g.GetGenres(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										14
									
								
								igdb.go
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								igdb.go
									
									
									
									
									
								
							| @@ -7,15 +7,15 @@ import ( | ||||
| 	"github.com/go-resty/resty/v2" | ||||
| ) | ||||
|  | ||||
| type igdb struct { | ||||
| type Client struct { | ||||
| 	clientID     string | ||||
| 	token        *twitchToken | ||||
| 	flaresolverr *flaresolverr.Flaresolverr | ||||
| 	limiter      *rateLimiter | ||||
| } | ||||
|  | ||||
| func New(clientID, clientSecret string) *igdb { | ||||
| 	return &igdb{ | ||||
| func New(clientID, clientSecret string) *Client { | ||||
| 	return &Client{ | ||||
| 		clientID:     clientID, | ||||
| 		limiter:      newRateLimiter(4), | ||||
| 		token:        NewTwitchToken(clientID, clientSecret), | ||||
| @@ -23,8 +23,8 @@ func New(clientID, clientSecret string) *igdb { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func NewWithFlaresolverr(clientID, clientSecret string, f *flaresolverr.Flaresolverr) *igdb { | ||||
| 	return &igdb{ | ||||
| func NewWithFlaresolverr(clientID, clientSecret string, f *flaresolverr.Flaresolverr) *Client { | ||||
| 	return &Client{ | ||||
| 		clientID:     clientID, | ||||
| 		limiter:      newRateLimiter(4), | ||||
| 		token:        NewTwitchToken(clientID, clientSecret), | ||||
| @@ -32,7 +32,7 @@ func NewWithFlaresolverr(clientID, clientSecret string, f *flaresolverr.Flaresol | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (g *igdb) Request(URL string, dataBody any) (*resty.Response, error) { | ||||
| func (g *Client) Request(URL string, dataBody any) (*resty.Response, error) { | ||||
| 	g.limiter.wait() | ||||
|  | ||||
| 	t, err := g.token.getToken() | ||||
| @@ -53,7 +53,7 @@ func (g *igdb) Request(URL string, dataBody any) (*resty.Response, error) { | ||||
| 	return resp, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) getFlaresolverr() (*flaresolverr.Flaresolverr, error) { | ||||
| func (g *Client) getFlaresolverr() (*flaresolverr.Flaresolverr, error) { | ||||
| 	if g.flaresolverr == nil { | ||||
| 		return nil, fmt.Errorf("flaresolverr is not initialized") | ||||
| 	} | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompanies(query string) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompanies(query string) ([]*pb.InvolvedCompany, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/involved_companies.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetInvolvedCompanies(query string) ([]*pb.InvolvedCompany, error) | ||||
| 	return data.Involvedcompanies, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompanyByID(id uint64) (*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompanyByID(id uint64) (*pb.InvolvedCompany, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	involvedCompanies, err := g.GetInvolvedCompanies(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetInvolvedCompanyByID(id uint64) (*pb.InvolvedCompany, error) { | ||||
| 	return involvedCompanies[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesByIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompaniesByIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetInvolvedCompaniesByIDs(ids []uint64) ([]*pb.InvolvedCompany, e | ||||
| 	return g.GetInvolvedCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesByGameID(id uint64) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompaniesByGameID(id uint64) ([]*pb.InvolvedCompany, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetInvolvedCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesByGameIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompaniesByGameIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetInvolvedCompaniesByGameIDs(ids []uint64) ([]*pb.InvolvedCompan | ||||
| 	return g.GetInvolvedCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesByCompanyID(id uint64) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompaniesByCompanyID(id uint64) ([]*pb.InvolvedCompany, error) { | ||||
| 	query := fmt.Sprintf(`where company = %d; fields *;`, id) | ||||
| 	return g.GetInvolvedCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesByCompanyIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| func (g *Client) GetInvolvedCompaniesByCompanyIDs(ids []uint64) ([]*pb.InvolvedCompany, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetInvolvedCompaniesByCompanyIDs(ids []uint64) ([]*pb.InvolvedCom | ||||
| 	return g.GetInvolvedCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetInvolvedCompaniesLength() (int, error) { | ||||
| func (g *Client) GetInvolvedCompaniesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	involvedCompanies, err := g.GetInvolvedCompanies(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetKeywords(query string) ([]*pb.Keyword, error) { | ||||
| func (g *Client) GetKeywords(query string) ([]*pb.Keyword, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/keywords.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetKeywords(query string) ([]*pb.Keyword, error) { | ||||
| 	return data.Keywords, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetKeywordByID(id uint64) (*pb.Keyword, error) { | ||||
| func (g *Client) GetKeywordByID(id uint64) (*pb.Keyword, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	keywords, err := g.GetKeywords(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetKeywordByID(id uint64) (*pb.Keyword, error) { | ||||
| 	return keywords[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetKeywordsByIDs(ids []uint64) ([]*pb.Keyword, error) { | ||||
| func (g *Client) GetKeywordsByIDs(ids []uint64) ([]*pb.Keyword, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetKeywordsByIDs(ids []uint64) ([]*pb.Keyword, error) { | ||||
| 	return g.GetKeywords(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetKeywordsLength() (int, error) { | ||||
| func (g *Client) GetKeywordsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	keywords, err := g.GetKeywords(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportTypes(query string) ([]*pb.LanguageSupportType, error) { | ||||
| func (g *Client) GetLanguageSupportTypes(query string) ([]*pb.LanguageSupportType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/language_support_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetLanguageSupportTypes(query string) ([]*pb.LanguageSupportType, | ||||
| 	return data.Languagesupporttypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportTypeByID(id uint64) (*pb.LanguageSupportType, error) { | ||||
| func (g *Client) GetLanguageSupportTypeByID(id uint64) (*pb.LanguageSupportType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	languageSupportTypes, err := g.GetLanguageSupportTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetLanguageSupportTypeByID(id uint64) (*pb.LanguageSupportType, e | ||||
| 	return languageSupportTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportTypesByIDs(ids []uint64) ([]*pb.LanguageSupportType, error) { | ||||
| func (g *Client) GetLanguageSupportTypesByIDs(ids []uint64) ([]*pb.LanguageSupportType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetLanguageSupportTypesByIDs(ids []uint64) ([]*pb.LanguageSupport | ||||
| 	return g.GetLanguageSupportTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportTypesLength() (int, error) { | ||||
| func (g *Client) GetLanguageSupportTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	languageSupportTypes, err := g.GetLanguageSupportTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetLanguageSupports(query string) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupports(query string) ([]*pb.LanguageSupport, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/language_supports.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetLanguageSupports(query string) ([]*pb.LanguageSupport, error) | ||||
| 	return data.Languagesupports, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportByID(id uint64) (*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportByID(id uint64) (*pb.LanguageSupport, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	languageSupports, err := g.GetLanguageSupports(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetLanguageSupportByID(id uint64) (*pb.LanguageSupport, error) { | ||||
| 	return languageSupports[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetLanguageSupportsByIDs(ids []uint64) ([]*pb.LanguageSupport, er | ||||
| 	return g.GetLanguageSupports(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByGameID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByGameID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetLanguageSupports(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByGameIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByGameIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetLanguageSupportsByGameIDs(ids []uint64) ([]*pb.LanguageSupport | ||||
| 	return g.GetLanguageSupports(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByLanguageID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByLanguageID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	query := fmt.Sprintf(`where language = %d; fields *;`, id) | ||||
| 	return g.GetLanguageSupports(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByLanguageIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByLanguageIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetLanguageSupportsByLanguageIDs(ids []uint64) ([]*pb.LanguageSup | ||||
| 	return g.GetLanguageSupports(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByLanguageSupportTypeID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByLanguageSupportTypeID(id uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	query := fmt.Sprintf(`where language_support_type = %d; fields *;`, id) | ||||
| 	return g.GetLanguageSupports(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsByLanguageSupportTypeIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| func (g *Client) GetLanguageSupportsByLanguageSupportTypeIDs(ids []uint64) ([]*pb.LanguageSupport, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,7 +95,7 @@ func (g *igdb) GetLanguageSupportsByLanguageSupportTypeIDs(ids []uint64) ([]*pb. | ||||
| 	return g.GetLanguageSupports(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageSupportsLength() (int, error) { | ||||
| func (g *Client) GetLanguageSupportsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	languageSupports, err := g.GetLanguageSupports(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetLanguages(query string) ([]*pb.Language, error) { | ||||
| func (g *Client) GetLanguages(query string) ([]*pb.Language, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/languages.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetLanguages(query string) ([]*pb.Language, error) { | ||||
| 	return data.Languages, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguageByID(id uint64) (*pb.Language, error) { | ||||
| func (g *Client) GetLanguageByID(id uint64) (*pb.Language, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	languages, err := g.GetLanguages(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetLanguageByID(id uint64) (*pb.Language, error) { | ||||
| 	return languages[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguagesByIDs(ids []uint64) ([]*pb.Language, error) { | ||||
| func (g *Client) GetLanguagesByIDs(ids []uint64) ([]*pb.Language, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetLanguagesByIDs(ids []uint64) ([]*pb.Language, error) { | ||||
| 	return g.GetLanguages(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetLanguagesLength() (int, error) { | ||||
| func (g *Client) GetLanguagesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	languages, err := g.GetLanguages(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModes(query string) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModes(query string) ([]*pb.MultiplayerMode, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/multiplayer_modes.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetMultiplayerModes(query string) ([]*pb.MultiplayerMode, error) | ||||
| 	return data.Multiplayermodes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModeByID(id uint64) (*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModeByID(id uint64) (*pb.MultiplayerMode, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	multiplayerModes, err := g.GetMultiplayerModes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetMultiplayerModeByID(id uint64) (*pb.MultiplayerMode, error) { | ||||
| 	return multiplayerModes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesByIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModesByIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetMultiplayerModesByIDs(ids []uint64) ([]*pb.MultiplayerMode, er | ||||
| 	return g.GetMultiplayerModes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesByGameID(id uint64) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModesByGameID(id uint64) ([]*pb.MultiplayerMode, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetMultiplayerModes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesByGameIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModesByGameIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetMultiplayerModesByGameIDs(ids []uint64) ([]*pb.MultiplayerMode | ||||
| 	return g.GetMultiplayerModes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesByPlatformID(id uint64) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModesByPlatformID(id uint64) ([]*pb.MultiplayerMode, error) { | ||||
| 	query := fmt.Sprintf(`where platform = %d; fields *;`, id) | ||||
| 	return g.GetMultiplayerModes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesByPlatformIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| func (g *Client) GetMultiplayerModesByPlatformIDs(ids []uint64) ([]*pb.MultiplayerMode, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetMultiplayerModesByPlatformIDs(ids []uint64) ([]*pb.Multiplayer | ||||
| 	return g.GetMultiplayerModes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetMultiplayerModesLength() (int, error) { | ||||
| func (g *Client) GetMultiplayerModesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	multiplayerModes, err := g.GetMultiplayerModes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetNetworkTypes(query string) ([]*pb.NetworkType, error) { | ||||
| func (g *Client) GetNetworkTypes(query string) ([]*pb.NetworkType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/network_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetNetworkTypes(query string) ([]*pb.NetworkType, error) { | ||||
| 	return data.Networktypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetNetworkTypeByID(id uint64) (*pb.NetworkType, error) { | ||||
| func (g *Client) GetNetworkTypeByID(id uint64) (*pb.NetworkType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	networkTypes, err := g.GetNetworkTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetNetworkTypeByID(id uint64) (*pb.NetworkType, error) { | ||||
| 	return networkTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetNetworkTypesByIDs(ids []uint64) ([]*pb.NetworkType, error) { | ||||
| func (g *Client) GetNetworkTypesByIDs(ids []uint64) ([]*pb.NetworkType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetNetworkTypesByIDs(ids []uint64) ([]*pb.NetworkType, error) { | ||||
| 	return g.GetNetworkTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetNetworkTypesLength() (int, error) { | ||||
| func (g *Client) GetNetworkTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	networkTypes, err := g.GetNetworkTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -4,7 +4,7 @@ import ( | ||||
| 	"fmt" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetParentGameID(id uint64) (uint64, error) { | ||||
| func (g *Client) GetParentGameID(id uint64) (uint64, error) { | ||||
| 	detail, err := g.GetGameByID(id) | ||||
| 	if err != nil { | ||||
| 		return 0, fmt.Errorf("failed to fetch IGDB app detail for parent: %d: %w", id, err) | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformFamilies(query string) ([]*pb.PlatformFamily, error) { | ||||
| func (g *Client) GetPlatformFamilies(query string) ([]*pb.PlatformFamily, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_families.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformFamilies(query string) ([]*pb.PlatformFamily, error) { | ||||
| 	return data.Platformfamilies, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformFamilyByID(id uint64) (*pb.PlatformFamily, error) { | ||||
| func (g *Client) GetPlatformFamilyByID(id uint64) (*pb.PlatformFamily, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformFamilies, err := g.GetPlatformFamilies(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformFamilyByID(id uint64) (*pb.PlatformFamily, error) { | ||||
| 	return platformFamilies[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformFamiliesByIDs(ids []uint64) ([]*pb.PlatformFamily, error) { | ||||
| func (g *Client) GetPlatformFamiliesByIDs(ids []uint64) ([]*pb.PlatformFamily, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetPlatformFamiliesByIDs(ids []uint64) ([]*pb.PlatformFamily, err | ||||
| 	return g.GetPlatformFamilies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformFamiliesLength() (int, error) { | ||||
| func (g *Client) GetPlatformFamiliesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformFamilies, err := g.GetPlatformFamilies(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformLogos(query string) ([]*pb.PlatformLogo, error) { | ||||
| func (g *Client) GetPlatformLogos(query string) ([]*pb.PlatformLogo, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_logos.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformLogos(query string) ([]*pb.PlatformLogo, error) { | ||||
| 	return data.Platformlogos, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformLogoByID(id uint64) (*pb.PlatformLogo, error) { | ||||
| func (g *Client) GetPlatformLogoByID(id uint64) (*pb.PlatformLogo, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformLogos, err := g.GetPlatformLogos(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformLogoByID(id uint64) (*pb.PlatformLogo, error) { | ||||
| 	return platformLogos[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformLogosByIDs(ids []uint64) ([]*pb.PlatformLogo, error) { | ||||
| func (g *Client) GetPlatformLogosByIDs(ids []uint64) ([]*pb.PlatformLogo, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetPlatformLogosByIDs(ids []uint64) ([]*pb.PlatformLogo, error) { | ||||
| 	return g.GetPlatformLogos(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformLogosLength() (int, error) { | ||||
| func (g *Client) GetPlatformLogosLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformLogos, err := g.GetPlatformLogos(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompanies(query string) ([]*pb.PlatformVersionCompany, error) { | ||||
| func (g *Client) GetPlatformVersionCompanies(query string) ([]*pb.PlatformVersionCompany, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_version_companies.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformVersionCompanies(query string) ([]*pb.PlatformVersionC | ||||
| 	return data.Platformversioncompanies, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompanyByID(id uint64) (*pb.PlatformVersionCompany, error) { | ||||
| func (g *Client) GetPlatformVersionCompanyByID(id uint64) (*pb.PlatformVersionCompany, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformVersionCompanies, err := g.GetPlatformVersionCompanies(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformVersionCompanyByID(id uint64) (*pb.PlatformVersionComp | ||||
| 	return platformVersionCompanies[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompaniesByIDs(ids []uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| func (g *Client) GetPlatformVersionCompaniesByIDs(ids []uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetPlatformVersionCompaniesByIDs(ids []uint64) ([]*pb.PlatformVer | ||||
| 	return g.GetPlatformVersionCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompaniesByCompanyID(id uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| func (g *Client) GetPlatformVersionCompaniesByCompanyID(id uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| 	query := fmt.Sprintf(`where company = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersionCompanies(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompaniesByCompanyIDs(ids []uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| func (g *Client) GetPlatformVersionCompaniesByCompanyIDs(ids []uint64) ([]*pb.PlatformVersionCompany, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetPlatformVersionCompaniesByCompanyIDs(ids []uint64) ([]*pb.Plat | ||||
| 	return g.GetPlatformVersionCompanies(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionCompaniesLength() (int, error) { | ||||
| func (g *Client) GetPlatformVersionCompaniesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformVersionCompanies, err := g.GetPlatformVersionCompanies(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDates(query string) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDates(query string) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_version_release_dates.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformVersionReleaseDates(query string) ([]*pb.PlatformVersi | ||||
| 	return data.Platformversionreleasedates, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDateByID(id uint64) (*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDateByID(id uint64) (*pb.PlatformVersionReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformVersionReleaseDates, err := g.GetPlatformVersionReleaseDates(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformVersionReleaseDateByID(id uint64) (*pb.PlatformVersion | ||||
| 	return platformVersionReleaseDates[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetPlatformVersionReleaseDatesByIDs(ids []uint64) ([]*pb.Platform | ||||
| 	return g.GetPlatformVersionReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByPlatformVersionID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByPlatformVersionID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where platform_version = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersionReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByPlatformVersionIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByPlatformVersionIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetPlatformVersionReleaseDatesByPlatformVersionIDs(ids []uint64) | ||||
| 	return g.GetPlatformVersionReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByReleaseRegionID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByReleaseRegionID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where release_region = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersionReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByReleaseRegionIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByReleaseRegionIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetPlatformVersionReleaseDatesByReleaseRegionIDs(ids []uint64) ([ | ||||
| 	return g.GetPlatformVersionReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByDateFormatID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByDateFormatID(id uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where date_format = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersionReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesByDateFormatIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesByDateFormatIDs(ids []uint64) ([]*pb.PlatformVersionReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,7 +95,7 @@ func (g *igdb) GetPlatformVersionReleaseDatesByDateFormatIDs(ids []uint64) ([]*p | ||||
| 	return g.GetPlatformVersionReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionReleaseDatesLength() (int, error) { | ||||
| func (g *Client) GetPlatformVersionReleaseDatesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformVersionReleaseDates, err := g.GetPlatformVersionReleaseDates(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformVersions(query string) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersions(query string) ([]*pb.PlatformVersion, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_versions.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformVersions(query string) ([]*pb.PlatformVersion, error) | ||||
| 	return data.Platformversions, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionByID(id uint64) (*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionByID(id uint64) (*pb.PlatformVersion, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformVersions, err := g.GetPlatformVersions(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformVersionByID(id uint64) (*pb.PlatformVersion, error) { | ||||
| 	return platformVersions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsByIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionsByIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetPlatformVersionsByIDs(ids []uint64) ([]*pb.PlatformVersion, er | ||||
| 	return g.GetPlatformVersions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsByMainManufacturerID(id uint64) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionsByMainManufacturerID(id uint64) ([]*pb.PlatformVersion, error) { | ||||
| 	query := fmt.Sprintf(`where main_manufacturer = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersions(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsByMainManufacturerIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionsByMainManufacturerIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetPlatformVersionsByMainManufacturerIDs(ids []uint64) ([]*pb.Pla | ||||
| 	return g.GetPlatformVersions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsByPlatformLogoID(id uint64) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionsByPlatformLogoID(id uint64) ([]*pb.PlatformVersion, error) { | ||||
| 	query := fmt.Sprintf(`where platform_logo = %d; fields *;`, id) | ||||
| 	return g.GetPlatformVersions(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsByPlatformLogoIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| func (g *Client) GetPlatformVersionsByPlatformLogoIDs(ids []uint64) ([]*pb.PlatformVersion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetPlatformVersionsByPlatformLogoIDs(ids []uint64) ([]*pb.Platfor | ||||
| 	return g.GetPlatformVersions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformVersionsLength() (int, error) { | ||||
| func (g *Client) GetPlatformVersionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformVersions, err := g.GetPlatformVersions(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatformWebsites(query string) ([]*pb.PlatformWebsite, error) { | ||||
| func (g *Client) GetPlatformWebsites(query string) ([]*pb.PlatformWebsite, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platform_websites.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlatformWebsites(query string) ([]*pb.PlatformWebsite, error) | ||||
| 	return data.Platformwebsites, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformWebsiteByID(id uint64) (*pb.PlatformWebsite, error) { | ||||
| func (g *Client) GetPlatformWebsiteByID(id uint64) (*pb.PlatformWebsite, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platformWebsites, err := g.GetPlatformWebsites(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlatformWebsiteByID(id uint64) (*pb.PlatformWebsite, error) { | ||||
| 	return platformWebsites[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformWebsitesByIDs(ids []uint64) ([]*pb.PlatformWebsite, error) { | ||||
| func (g *Client) GetPlatformWebsitesByIDs(ids []uint64) ([]*pb.PlatformWebsite, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetPlatformWebsitesByIDs(ids []uint64) ([]*pb.PlatformWebsite, er | ||||
| 	return g.GetPlatformWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformWebsitesLength() (int, error) { | ||||
| func (g *Client) GetPlatformWebsitesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platformWebsites, err := g.GetPlatformWebsites(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										20
									
								
								platforms.go
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								platforms.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlatforms(query string) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatforms(query string) ([]*pb.Platform, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/platforms.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -26,7 +26,7 @@ func (g *igdb) GetPlatforms(query string) ([]*pb.Platform, error) { | ||||
| 	return data.Platforms, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformByID(id uint64) (*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformByID(id uint64) (*pb.Platform, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	platforms, err := g.GetPlatforms(query) | ||||
| 	if err != nil { | ||||
| @@ -35,7 +35,7 @@ func (g *igdb) GetPlatformByID(id uint64) (*pb.Platform, error) { | ||||
| 	return platforms[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -46,12 +46,12 @@ func (g *igdb) GetPlatformsByIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| 	return g.GetPlatforms(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformFamilyID(id uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformFamilyID(id uint64) ([]*pb.Platform, error) { | ||||
| 	query := fmt.Sprintf(`where platform_family = %d; fields *;`, id) | ||||
| 	return g.GetPlatforms(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformFamilyIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformFamilyIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -62,12 +62,12 @@ func (g *igdb) GetPlatformsByPlatformFamilyIDs(ids []uint64) ([]*pb.Platform, er | ||||
| 	return g.GetPlatforms(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformLogoID(id uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformLogoID(id uint64) ([]*pb.Platform, error) { | ||||
| 	query := fmt.Sprintf(`where platform_logo = %d; fields *;`, id) | ||||
| 	return g.GetPlatforms(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformLogoIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformLogoIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -78,12 +78,12 @@ func (g *igdb) GetPlatformsByPlatformLogoIDs(ids []uint64) ([]*pb.Platform, erro | ||||
| 	return g.GetPlatforms(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformTypeID(id uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformTypeID(id uint64) ([]*pb.Platform, error) { | ||||
| 	query := fmt.Sprintf(`where platform_type = %d; fields *;`, id) | ||||
| 	return g.GetPlatforms(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsByPlatformTypeIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| func (g *Client) GetPlatformsByPlatformTypeIDs(ids []uint64) ([]*pb.Platform, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -94,7 +94,7 @@ func (g *igdb) GetPlatformsByPlatformTypeIDs(ids []uint64) ([]*pb.Platform, erro | ||||
| 	return g.GetPlatforms(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlatformsLength() (int, error) { | ||||
| func (g *Client) GetPlatformsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	platforms, err := g.GetPlatforms(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPlayerPerspectives(query string) ([]*pb.PlayerPerspective, error) { | ||||
| func (g *Client) GetPlayerPerspectives(query string) ([]*pb.PlayerPerspective, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/player_perspectives.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPlayerPerspectives(query string) ([]*pb.PlayerPerspective, err | ||||
| 	return data.Playerperspectives, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlayerPerspectiveByID(id uint64) (*pb.PlayerPerspective, error) { | ||||
| func (g *Client) GetPlayerPerspectiveByID(id uint64) (*pb.PlayerPerspective, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	playerPerspectives, err := g.GetPlayerPerspectives(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPlayerPerspectiveByID(id uint64) (*pb.PlayerPerspective, error | ||||
| 	return playerPerspectives[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlayerPerspectivesByIDs(ids []uint64) ([]*pb.PlayerPerspective, error) { | ||||
| func (g *Client) GetPlayerPerspectivesByIDs(ids []uint64) ([]*pb.PlayerPerspective, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetPlayerPerspectivesByIDs(ids []uint64) ([]*pb.PlayerPerspective | ||||
| 	return g.GetPlayerPerspectives(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPlayerPerspectivesLength() (int, error) { | ||||
| func (g *Client) GetPlayerPerspectivesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	playerPerspectives, err := g.GetPlayerPerspectives(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitives(query string) ([]*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitives(query string) ([]*pb.PopularityPrimitive, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/popularity_primitives.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPopularityPrimitives(query string) ([]*pb.PopularityPrimitive, | ||||
| 	return data.Popularityprimitives, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitiveByID(id uint64) (*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitiveByID(id uint64) (*pb.PopularityPrimitive, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	popularityPrimitives, err := g.GetPopularityPrimitives(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPopularityPrimitiveByID(id uint64) (*pb.PopularityPrimitive, e | ||||
| 	return popularityPrimitives[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitivesByIDs(ids []uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitivesByIDs(ids []uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -52,17 +52,17 @@ func (g *igdb) GetPopularityPrimitivesByIDs(ids []uint64) ([]*pb.PopularityPrimi | ||||
| // popularity_type = 2 IGDB Want to Play | ||||
| // popularity_type = 3 IGDB Playing | ||||
| // popularity_type = 4 IGDB Played | ||||
| func (g *igdb) GetPopularityPrimitivesByPopularityType(popularityType, offset, limit int) ([]*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitivesByPopularityType(popularityType, offset, limit int) ([]*pb.PopularityPrimitive, error) { | ||||
| 	query := fmt.Sprintf("fields game_id,value,popularity_type; sort value desc; limit %d; offset %d; where popularity_type = %d;", limit, offset, popularityType) | ||||
| 	return g.GetPopularityPrimitives(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitivesByExternalPopularitySourceID(id uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitivesByExternalPopularitySourceID(id uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| 	query := fmt.Sprintf(`where external_popularity_source = %d; fields *;`, id) | ||||
| 	return g.GetPopularityPrimitives(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitivesByExternalPopularitySourceIDs(ids []uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| func (g *Client) GetPopularityPrimitivesByExternalPopularitySourceIDs(ids []uint64) ([]*pb.PopularityPrimitive, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -73,7 +73,7 @@ func (g *igdb) GetPopularityPrimitivesByExternalPopularitySourceIDs(ids []uint64 | ||||
| 	return g.GetPopularityPrimitives(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityPrimitivesLength() (int, error) { | ||||
| func (g *Client) GetPopularityPrimitivesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	popularityPrimitives, err := g.GetPopularityPrimitives(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetPopularityTypes(query string) ([]*pb.PopularityType, error) { | ||||
| func (g *Client) GetPopularityTypes(query string) ([]*pb.PopularityType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/popularity_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetPopularityTypes(query string) ([]*pb.PopularityType, error) { | ||||
| 	return data.Popularitytypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityTypeByID(id uint64) (*pb.PopularityType, error) { | ||||
| func (g *Client) GetPopularityTypeByID(id uint64) (*pb.PopularityType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	popularityTypes, err := g.GetPopularityTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetPopularityTypeByID(id uint64) (*pb.PopularityType, error) { | ||||
| 	return popularityTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityTypesByIDs(ids []uint64) ([]*pb.PopularityType, error) { | ||||
| func (g *Client) GetPopularityTypesByIDs(ids []uint64) ([]*pb.PopularityType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetPopularityTypesByIDs(ids []uint64) ([]*pb.PopularityType, erro | ||||
| 	return g.GetPopularityTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityTypesByExternalPopularitySourceID(id uint64) ([]*pb.PopularityType, error) { | ||||
| func (g *Client) GetPopularityTypesByExternalPopularitySourceID(id uint64) ([]*pb.PopularityType, error) { | ||||
| 	query := fmt.Sprintf(`where external_popularity_source = %d; fields *;`, id) | ||||
| 	return g.GetPopularityTypes(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityTypesByExternalPopularitySourceIDs(ids []uint64) ([]*pb.PopularityType, error) { | ||||
| func (g *Client) GetPopularityTypesByExternalPopularitySourceIDs(ids []uint64) ([]*pb.PopularityType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetPopularityTypesByExternalPopularitySourceIDs(ids []uint64) ([] | ||||
| 	return g.GetPopularityTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetPopularityTypesLength() (int, error) { | ||||
| func (g *Client) GetPopularityTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	popularityTypes, err := g.GetPopularityTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetRegions(query string) ([]*pb.Region, error) { | ||||
| func (g *Client) GetRegions(query string) ([]*pb.Region, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/regions.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetRegions(query string) ([]*pb.Region, error) { | ||||
| 	return data.Regions, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetRegionByID(id uint64) (*pb.Region, error) { | ||||
| func (g *Client) GetRegionByID(id uint64) (*pb.Region, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	regions, err := g.GetRegions(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetRegionByID(id uint64) (*pb.Region, error) { | ||||
| 	return regions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetRegionsByIDs(ids []uint64) ([]*pb.Region, error) { | ||||
| func (g *Client) GetRegionsByIDs(ids []uint64) ([]*pb.Region, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetRegionsByIDs(ids []uint64) ([]*pb.Region, error) { | ||||
| 	return g.GetRegions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetRegionsLength() (int, error) { | ||||
| func (g *Client) GetRegionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	regions, err := g.GetRegions(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetReleaseDateRegions(query string) ([]*pb.ReleaseDateRegion, error) { | ||||
| func (g *Client) GetReleaseDateRegions(query string) ([]*pb.ReleaseDateRegion, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/release_date_regions.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetReleaseDateRegions(query string) ([]*pb.ReleaseDateRegion, err | ||||
| 	return data.Releasedateregions, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateRegionByID(id uint64) (*pb.ReleaseDateRegion, error) { | ||||
| func (g *Client) GetReleaseDateRegionByID(id uint64) (*pb.ReleaseDateRegion, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	releaseDateRegions, err := g.GetReleaseDateRegions(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetReleaseDateRegionByID(id uint64) (*pb.ReleaseDateRegion, error | ||||
| 	return releaseDateRegions[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateRegionsByIDs(ids []uint64) ([]*pb.ReleaseDateRegion, error) { | ||||
| func (g *Client) GetReleaseDateRegionsByIDs(ids []uint64) ([]*pb.ReleaseDateRegion, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetReleaseDateRegionsByIDs(ids []uint64) ([]*pb.ReleaseDateRegion | ||||
| 	return g.GetReleaseDateRegions(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateRegionsLength() (int, error) { | ||||
| func (g *Client) GetReleaseDateRegionsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	releaseDateRegions, err := g.GetReleaseDateRegions(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetReleaseDateStatuses(query string) ([]*pb.ReleaseDateStatus, error) { | ||||
| func (g *Client) GetReleaseDateStatuses(query string) ([]*pb.ReleaseDateStatus, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/release_date_statuses.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetReleaseDateStatuses(query string) ([]*pb.ReleaseDateStatus, er | ||||
| 	return data.Releasedatestatuses, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateStatusByID(id uint64) (*pb.ReleaseDateStatus, error) { | ||||
| func (g *Client) GetReleaseDateStatusByID(id uint64) (*pb.ReleaseDateStatus, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	releaseDateStatuses, err := g.GetReleaseDateStatuses(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetReleaseDateStatusByID(id uint64) (*pb.ReleaseDateStatus, error | ||||
| 	return releaseDateStatuses[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateStatusesByIDs(ids []uint64) ([]*pb.ReleaseDateStatus, error) { | ||||
| func (g *Client) GetReleaseDateStatusesByIDs(ids []uint64) ([]*pb.ReleaseDateStatus, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetReleaseDateStatusesByIDs(ids []uint64) ([]*pb.ReleaseDateStatu | ||||
| 	return g.GetReleaseDateStatuses(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateStatusesLength() (int, error) { | ||||
| func (g *Client) GetReleaseDateStatusesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	releaseDateStatuses, err := g.GetReleaseDateStatuses(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetReleaseDates(query string) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDates(query string) ([]*pb.ReleaseDate, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/release_dates.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetReleaseDates(query string) ([]*pb.ReleaseDate, error) { | ||||
| 	return data.Releasedates, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDateByID(id uint64) (*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDateByID(id uint64) (*pb.ReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	releaseDates, err := g.GetReleaseDates(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetReleaseDateByID(id uint64) (*pb.ReleaseDate, error) { | ||||
| 	return releaseDates[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetReleaseDatesByIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	return g.GetReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByGameID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByGameID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByGameIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByGameIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetReleaseDatesByGameIDs(ids []uint64) ([]*pb.ReleaseDate, error) | ||||
| 	return g.GetReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByPlatformID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByPlatformID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where platform = %d; fields *;`, id) | ||||
| 	return g.GetReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByPlatformIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByPlatformIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,12 +79,12 @@ func (g *igdb) GetReleaseDatesByPlatformIDs(ids []uint64) ([]*pb.ReleaseDate, er | ||||
| 	return g.GetReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByReleaseRegionID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByReleaseRegionID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where release_region = %d; fields *;`, id) | ||||
| 	return g.GetReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByReleaseRegionIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByReleaseRegionIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -95,12 +95,12 @@ func (g *igdb) GetReleaseDatesByReleaseRegionIDs(ids []uint64) ([]*pb.ReleaseDat | ||||
| 	return g.GetReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByStatusID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByStatusID(id uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	query := fmt.Sprintf(`where status = %d; fields *;`, id) | ||||
| 	return g.GetReleaseDates(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesByStatusIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| func (g *Client) GetReleaseDatesByStatusIDs(ids []uint64) ([]*pb.ReleaseDate, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -111,7 +111,7 @@ func (g *igdb) GetReleaseDatesByStatusIDs(ids []uint64) ([]*pb.ReleaseDate, erro | ||||
| 	return g.GetReleaseDates(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetReleaseDatesLength() (int, error) { | ||||
| func (g *Client) GetReleaseDatesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	releaseDates, err := g.GetReleaseDates(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetScreenshots(query string) ([]*pb.Screenshot, error) { | ||||
| func (g *Client) GetScreenshots(query string) ([]*pb.Screenshot, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/screenshots.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetScreenshots(query string) ([]*pb.Screenshot, error) { | ||||
| 	return data.Screenshots, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetScreenshotByID(id uint64) (*pb.Screenshot, error) { | ||||
| func (g *Client) GetScreenshotByID(id uint64) (*pb.Screenshot, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	screenshots, err := g.GetScreenshots(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetScreenshotByID(id uint64) (*pb.Screenshot, error) { | ||||
| 	return screenshots[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetScreenshotsByIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| func (g *Client) GetScreenshotsByIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetScreenshotsByIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| 	return g.GetScreenshots(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetScreenshotsByGameID(id uint64) ([]*pb.Screenshot, error) { | ||||
| func (g *Client) GetScreenshotsByGameID(id uint64) ([]*pb.Screenshot, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetScreenshots(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetScreenshotsByGameIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| func (g *Client) GetScreenshotsByGameIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,7 +63,7 @@ func (g *igdb) GetScreenshotsByGameIDs(ids []uint64) ([]*pb.Screenshot, error) { | ||||
| 	return g.GetScreenshots(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetScreenshotsLength() (int, error) { | ||||
| func (g *Client) GetScreenshotsLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	screenshots, err := g.GetScreenshots(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -21,7 +21,7 @@ var webSearchCFCookies struct { | ||||
| 	expires time.Time | ||||
| } | ||||
|  | ||||
| func (g *igdb) Search(query string) ([]*pb.Search, error) { | ||||
| func (g *Client) Search(query string) ([]*pb.Search, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/search.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -39,7 +39,7 @@ func (g *igdb) Search(query string) ([]*pb.Search, error) { | ||||
| 	return data.Searches, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) WebSearchGames(name string) ([]*pb.Game, error) { | ||||
| func (g *Client) WebSearchGames(name string) ([]*pb.Game, error) { | ||||
| 	params := url.Values{} | ||||
| 	params.Add("q", name) | ||||
| 	params.Add("utf8", "✓") | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetThemes(query string) ([]*pb.Theme, error) { | ||||
| func (g *Client) GetThemes(query string) ([]*pb.Theme, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/themes.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetThemes(query string) ([]*pb.Theme, error) { | ||||
| 	return data.Themes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetThemeByID(id uint64) (*pb.Theme, error) { | ||||
| func (g *Client) GetThemeByID(id uint64) (*pb.Theme, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	themes, err := g.GetThemes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetThemeByID(id uint64) (*pb.Theme, error) { | ||||
| 	return themes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetThemesByIDs(ids []uint64) ([]*pb.Theme, error) { | ||||
| func (g *Client) GetThemesByIDs(ids []uint64) ([]*pb.Theme, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetThemesByIDs(ids []uint64) ([]*pb.Theme, error) { | ||||
| 	return g.GetThemes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetThemesLength() (int, error) { | ||||
| func (g *Client) GetThemesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	themes, err := g.GetThemes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -8,7 +8,7 @@ import ( | ||||
| 	"github.com/bestnite/go-igdb/endpoint" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) ActiveWebhook(endpoint endpoint.Endpoint, secret, callbackUrl string) error { | ||||
| func (g *Client) ActiveWebhook(endpoint endpoint.Endpoint, secret, callbackUrl string) error { | ||||
| 	dataBody := url.Values{} | ||||
| 	dataBody.Set("url", callbackUrl) | ||||
| 	dataBody.Set("secret", secret) | ||||
|   | ||||
| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetWebsiteTypes(query string) ([]*pb.WebsiteType, error) { | ||||
| func (g *Client) GetWebsiteTypes(query string) ([]*pb.WebsiteType, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/website_types.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetWebsiteTypes(query string) ([]*pb.WebsiteType, error) { | ||||
| 	return data.Websitetypes, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsiteTypeByID(id uint64) (*pb.WebsiteType, error) { | ||||
| func (g *Client) GetWebsiteTypeByID(id uint64) (*pb.WebsiteType, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	websiteTypes, err := g.GetWebsiteTypes(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetWebsiteTypeByID(id uint64) (*pb.WebsiteType, error) { | ||||
| 	return websiteTypes[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsiteTypesByIDs(ids []uint64) ([]*pb.WebsiteType, error) { | ||||
| func (g *Client) GetWebsiteTypesByIDs(ids []uint64) ([]*pb.WebsiteType, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,7 +47,7 @@ func (g *igdb) GetWebsiteTypesByIDs(ids []uint64) ([]*pb.WebsiteType, error) { | ||||
| 	return g.GetWebsiteTypes(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsiteTypesLength() (int, error) { | ||||
| func (g *Client) GetWebsiteTypesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	websiteTypes, err := g.GetWebsiteTypes(query) | ||||
| 	if err != nil { | ||||
|   | ||||
							
								
								
									
										16
									
								
								websites.go
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								websites.go
									
									
									
									
									
								
							| @@ -9,7 +9,7 @@ import ( | ||||
| 	"google.golang.org/protobuf/proto" | ||||
| ) | ||||
|  | ||||
| func (g *igdb) GetWebsites(query string) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsites(query string) ([]*pb.Website, error) { | ||||
| 	resp, err := g.Request("https://api.igdb.com/v4/websites.pb", query) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("failed to request: %w", err) | ||||
| @@ -27,7 +27,7 @@ func (g *igdb) GetWebsites(query string) ([]*pb.Website, error) { | ||||
| 	return data.Websites, nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsiteByID(id uint64) (*pb.Website, error) { | ||||
| func (g *Client) GetWebsiteByID(id uint64) (*pb.Website, error) { | ||||
| 	query := fmt.Sprintf(`where id=%d; fields *;`, id) | ||||
| 	websites, err := g.GetWebsites(query) | ||||
| 	if err != nil { | ||||
| @@ -36,7 +36,7 @@ func (g *igdb) GetWebsiteByID(id uint64) (*pb.Website, error) { | ||||
| 	return websites[0], nil | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesByIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsitesByIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -47,12 +47,12 @@ func (g *igdb) GetWebsitesByIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	return g.GetWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesByGameID(id uint64) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsitesByGameID(id uint64) ([]*pb.Website, error) { | ||||
| 	query := fmt.Sprintf(`where game = %d; fields *;`, id) | ||||
| 	return g.GetWebsites(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesByGameIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsitesByGameIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -63,12 +63,12 @@ func (g *igdb) GetWebsitesByGameIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	return g.GetWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesByTypeID(id uint64) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsitesByTypeID(id uint64) ([]*pb.Website, error) { | ||||
| 	query := fmt.Sprintf(`where type = %d; fields *;`, id) | ||||
| 	return g.GetWebsites(query) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesByTypeIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| func (g *Client) GetWebsitesByTypeIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	idStrSlice := make([]string, len(ids)) | ||||
| 	for i, id := range ids { | ||||
| 		idStrSlice[i] = fmt.Sprintf("%d", id) | ||||
| @@ -79,7 +79,7 @@ func (g *igdb) GetWebsitesByTypeIDs(ids []uint64) ([]*pb.Website, error) { | ||||
| 	return g.GetWebsites(idStr) | ||||
| } | ||||
|  | ||||
| func (g *igdb) GetWebsitesLength() (int, error) { | ||||
| func (g *Client) GetWebsitesLength() (int, error) { | ||||
| 	query := `fields *; sort id desc; limit 1;` | ||||
| 	websites, err := g.GetWebsites(query) | ||||
| 	if err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user