diff --git a/age_rating_categories.go b/age_rating_categories.go index 8991b52..ebc4847 100644 --- a/age_rating_categories.go +++ b/age_rating_categories.go @@ -45,3 +45,19 @@ func (g *igdb) GetAgeRatingCategoriesByIDs(ids []uint64) ([]*pb.AgeRatingCategor return g.GetAgeRatingCategories(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where organization = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetAgeRatingCategories(idStr) +} diff --git a/age_rating_content_descriptions_v2.go b/age_rating_content_descriptions_v2.go index 2c1f743..7d84ee8 100644 --- a/age_rating_content_descriptions_v2.go +++ b/age_rating_content_descriptions_v2.go @@ -45,3 +45,19 @@ func (g *igdb) GetAgeRatingContentDescriptionsV2ByIDs(ids []uint64) ([]*pb.AgeRa return g.GetAgeRatingContentDescriptionsV2(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where organization = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetAgeRatingContentDescriptionsV2(idStr) +} diff --git a/age_ratings.go b/age_ratings.go index 0d03f5f..76abef9 100644 --- a/age_ratings.go +++ b/age_ratings.go @@ -45,3 +45,35 @@ func (g *igdb) GetAgeRatingsByIDs(ids []uint64) ([]*pb.AgeRating, error) { return g.GetAgeRatings(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where organization = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetAgeRatings(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where rating_category = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetAgeRatings(idStr) +} diff --git a/alternative_names.go b/alternative_names.go index 8592c15..6f7e27d 100644 --- a/alternative_names.go +++ b/alternative_names.go @@ -45,3 +45,19 @@ func (g *igdb) GetAlternativeNamesByIDs(ids []uint64) ([]*pb.AlternativeName, er return g.GetAlternativeNames(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetAlternativeNames(idStr) +} diff --git a/artworks.go b/artworks.go index f0e70ab..26c0d42 100644 --- a/artworks.go +++ b/artworks.go @@ -46,3 +46,19 @@ func (g *igdb) GetArtworksByIDs(ids []uint64) ([]*pb.Artwork, error) { return g.GetArtworks(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetArtworks(idStr) +} diff --git a/characters.go b/characters.go index 94ae041..eb30248 100644 --- a/characters.go +++ b/characters.go @@ -46,3 +46,51 @@ func (g *igdb) GetCharactersByIDs(ids []uint64) ([]*pb.Character, error) { return g.GetCharacters(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where character_gender = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCharacters(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where character_species = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCharacters(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where mug_shot = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCharacters(idStr) +} diff --git a/collection_membership_types.go b/collection_membership_types.go index 162f78c..35ad910 100644 --- a/collection_membership_types.go +++ b/collection_membership_types.go @@ -45,3 +45,19 @@ func (g *igdb) GetCollectionMembershipTypesByIDs(ids []uint64) ([]*pb.Collection return g.GetCollectionMembershipTypes(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where allowed_collection_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionMembershipTypes(idStr) +} diff --git a/collection_memberships.go b/collection_memberships.go index 88b15cf..f57421e 100644 --- a/collection_memberships.go +++ b/collection_memberships.go @@ -45,3 +45,40 @@ func (g *igdb) GetCollectionMembershipsByIDs(ids []uint64) ([]*pb.CollectionMemb return g.GetCollectionMemberships(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionMemberships(idStr) +} + +func (g *igdb) 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) { + query := fmt.Sprintf(`where type = %d; fields *;`, id) + return g.GetCollectionMemberships(query) +} + +func (g *igdb) GetCollectionMembershipsByCollectionMembershipTypeIDs(ids []uint64) ([]*pb.CollectionMembership, error) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionMemberships(idStr) +} diff --git a/collection_relation_types.go b/collection_relation_types.go index b61b1f4..bf69cfc 100644 --- a/collection_relation_types.go +++ b/collection_relation_types.go @@ -45,3 +45,35 @@ func (g *igdb) GetCollectionRelationTypesByIDs(ids []uint64) ([]*pb.CollectionRe return g.GetCollectionRelationTypes(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where allowed_child_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionRelationTypes(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where allowed_parent_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionRelationTypes(idStr) +} diff --git a/collection_relations.go b/collection_relations.go index af314e9..3cd89fc 100644 --- a/collection_relations.go +++ b/collection_relations.go @@ -45,3 +45,51 @@ func (g *igdb) GetCollectionRelationsByIDs(ids []uint64) ([]*pb.CollectionRelati return g.GetCollectionRelations(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where child_collection = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionRelations(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where parent_collection = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionRelations(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollectionRelations(idStr) +} diff --git a/collections.go b/collections.go index 9a8b11a..bb15133 100644 --- a/collections.go +++ b/collections.go @@ -46,3 +46,19 @@ func (g *igdb) GetCollectionsByIDs(ids []uint64) ([]*pb.Collection, error) { return g.GetCollections(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where collection_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCollections(idStr) +} diff --git a/companies.go b/companies.go index 83e069c..b2db1e0 100644 --- a/companies.go +++ b/companies.go @@ -47,3 +47,99 @@ func (g *igdb) GetCompanyByIDs(ids []uint64) ([]*pb.Company, error) { return g.GetCompanies(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where change_date_format = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where changed_company_id = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where logo = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where parent = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where start_date_format = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where status = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanies(idStr) +} diff --git a/company_websites.go b/company_websites.go index 9926a02..6e5152b 100644 --- a/company_websites.go +++ b/company_websites.go @@ -45,3 +45,19 @@ func (g *igdb) GetCompanyWebsitesByIDs(ids []uint64) ([]*pb.CompanyWebsite, erro return g.GetCompanyWebsites(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCompanyWebsites(idStr) +} diff --git a/covers.go b/covers.go index 1d285ce..ae83b41 100644 --- a/covers.go +++ b/covers.go @@ -45,3 +45,35 @@ func (g *igdb) GetCoversByIDs(ids []uint64) ([]*pb.Cover, error) { return g.GetCovers(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCovers(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game_localization = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetCovers(idStr) +} diff --git a/event_logos.go b/event_logos.go index 2adfd7b..3ccfcee 100644 --- a/event_logos.go +++ b/event_logos.go @@ -45,3 +45,19 @@ func (g *igdb) GetEventLogosByIDs(ids []uint64) ([]*pb.EventLogo, error) { return g.GetEventLogos(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where event = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetEventLogos(idStr) +} diff --git a/event_networks.go b/event_networks.go index 8ab2214..74828f4 100644 --- a/event_networks.go +++ b/event_networks.go @@ -45,3 +45,35 @@ func (g *igdb) GetEventNetworksByIDs(ids []uint64) ([]*pb.EventNetwork, error) { return g.GetEventNetworks(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where event = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetEventNetworks(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where network_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetEventNetworks(idStr) +} diff --git a/events.go b/events.go index 154b821..4ac096e 100644 --- a/events.go +++ b/events.go @@ -46,3 +46,19 @@ func (g *igdb) GetEventsByIDs(ids []uint64) ([]*pb.Event, error) { return g.GetEvents(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where event_logo = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetEvents(idStr) +} diff --git a/external_games.go b/external_games.go index b353cbb..d1ea5b9 100644 --- a/external_games.go +++ b/external_games.go @@ -64,3 +64,56 @@ 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) { + query := fmt.Sprintf(`where game = %d; fields *;`, id) + return g.GetExternalGames(query) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where external_game_source = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetExternalGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game_release_format = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetExternalGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_version = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetExternalGames(idStr) +} diff --git a/game_engines.go b/game_engines.go index 7cb8012..a643382 100644 --- a/game_engines.go +++ b/game_engines.go @@ -46,3 +46,35 @@ func (g *igdb) GetGameEnginesByIDs(ids []uint64) ([]*pb.GameEngine, error) { return g.GetGameEngines(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameEngines(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where logo = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameEngines(idStr) +} diff --git a/game_localizations.go b/game_localizations.go index 1d1a51d..6a97ae6 100644 --- a/game_localizations.go +++ b/game_localizations.go @@ -45,3 +45,51 @@ func (g *igdb) GetGameLocalizationsByIDs(ids []uint64) ([]*pb.GameLocalization, return g.GetGameLocalizations(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameLocalizations(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where cover = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameLocalizations(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where region = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameLocalizations(idStr) +} diff --git a/game_version_feature_values.go b/game_version_feature_values.go index 990f233..b9af0ef 100644 --- a/game_version_feature_values.go +++ b/game_version_feature_values.go @@ -45,3 +45,35 @@ func (g *igdb) GetGameVersionFeatureValuesByIDs(ids []uint64) ([]*pb.GameVersion return g.GetGameVersionFeatureValues(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameVersionFeatureValues(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game_version_feature = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameVersionFeatureValues(idStr) +} diff --git a/game_versions.go b/game_versions.go index 5e7ae09..68f20e3 100644 --- a/game_versions.go +++ b/game_versions.go @@ -45,3 +45,19 @@ func (g *igdb) GetGameVersionsByIDs(ids []uint64) ([]*pb.GameVersion, error) { return g.GetGameVersions(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameVersions(idStr) +} diff --git a/game_videos.go b/game_videos.go index a1e7bf2..a1d5c38 100644 --- a/game_videos.go +++ b/game_videos.go @@ -45,3 +45,19 @@ func (g *igdb) GetGameVideosByIDs(ids []uint64) ([]*pb.GameVideo, error) { return g.GetGameVideos(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGameVideos(idStr) +} diff --git a/games.go b/games.go index 9a03f90..4d92108 100644 --- a/games.go +++ b/games.go @@ -46,3 +46,115 @@ func (g *igdb) GetGameByIDs(ids []uint64) ([]*pb.Game, error) { return g.GetGames(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where collection = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where cover = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where franchise = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game_status = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where parent_game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where version_parent = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetGames(idStr) +} diff --git a/involved_companies.go b/involved_companies.go index 5df647d..85e815a 100644 --- a/involved_companies.go +++ b/involved_companies.go @@ -45,3 +45,35 @@ func (g *igdb) GetInvolvedCompaniesByIDs(ids []uint64) ([]*pb.InvolvedCompany, e return g.GetInvolvedCompanies(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetInvolvedCompanies(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where company = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetInvolvedCompanies(idStr) +} diff --git a/language_supports.go b/language_supports.go index a9491d8..c6cc34f 100644 --- a/language_supports.go +++ b/language_supports.go @@ -45,3 +45,51 @@ func (g *igdb) GetLanguageSupportsByIDs(ids []uint64) ([]*pb.LanguageSupport, er return g.GetLanguageSupports(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetLanguageSupports(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where language = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetLanguageSupports(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where language_support_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetLanguageSupports(idStr) +} diff --git a/multiplayer_modes.go b/multiplayer_modes.go index 95eda9c..8e16b6f 100644 --- a/multiplayer_modes.go +++ b/multiplayer_modes.go @@ -45,3 +45,35 @@ func (g *igdb) GetMultiplayerModesByIDs(ids []uint64) ([]*pb.MultiplayerMode, er return g.GetMultiplayerModes(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetMultiplayerModes(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetMultiplayerModes(idStr) +} diff --git a/platform_version_companies.go b/platform_version_companies.go index 0159d7a..34d2a3a 100644 --- a/platform_version_companies.go +++ b/platform_version_companies.go @@ -45,3 +45,19 @@ func (g *igdb) GetPlatformVersionCompaniesByIDs(ids []uint64) ([]*pb.PlatformVer return g.GetPlatformVersionCompanies(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where company = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersionCompanies(idStr) +} diff --git a/platform_version_release_dates.go b/platform_version_release_dates.go index 0248b2a..5021d60 100644 --- a/platform_version_release_dates.go +++ b/platform_version_release_dates.go @@ -45,3 +45,51 @@ func (g *igdb) GetPlatformVersionReleaseDatesByIDs(ids []uint64) ([]*pb.Platform return g.GetPlatformVersionReleaseDates(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_version = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersionReleaseDates(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where release_region = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersionReleaseDates(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where date_format = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersionReleaseDates(idStr) +} diff --git a/platform_versions.go b/platform_versions.go index 3a87490..7510cd7 100644 --- a/platform_versions.go +++ b/platform_versions.go @@ -45,3 +45,35 @@ func (g *igdb) GetPlatformVersionsByIDs(ids []uint64) ([]*pb.PlatformVersion, er return g.GetPlatformVersions(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where main_manufacturer = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersions(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_logo = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatformVersions(idStr) +} diff --git a/platforms.go b/platforms.go index cfad5df..20533de 100644 --- a/platforms.go +++ b/platforms.go @@ -44,3 +44,51 @@ func (g *igdb) GetPlatformsByIDs(ids []uint64) ([]*pb.Platform, error) { return g.GetPlatforms(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_family = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatforms(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_logo = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatforms(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform_type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPlatforms(idStr) +} diff --git a/popularity_primitives.go b/popularity_primitives.go index deb96de..665818c 100644 --- a/popularity_primitives.go +++ b/popularity_primitives.go @@ -55,3 +55,19 @@ func (g *igdb) GetPopularityPrimitivesByPopularityType(popularityType, offset, l 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) { + query := fmt.Sprintf(`where external_popularity_source = %d; fields *;`, id) + return g.GetPopularityPrimitives(query) +} + +func (g *igdb) GetPopularityPrimitivesByExternalPopularitySourceIDs(ids []uint64) ([]*pb.PopularityPrimitive, error) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where external_popularity_source = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPopularityPrimitives(idStr) +} diff --git a/popularity_types.go b/popularity_types.go index 701b9dd..f23627d 100644 --- a/popularity_types.go +++ b/popularity_types.go @@ -45,3 +45,19 @@ func (g *igdb) GetPopularityTypesByIDs(ids []uint64) ([]*pb.PopularityType, erro return g.GetPopularityTypes(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where external_popularity_source = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetPopularityTypes(idStr) +} diff --git a/release_dates.go b/release_dates.go index 06e43d8..5ca5334 100644 --- a/release_dates.go +++ b/release_dates.go @@ -45,3 +45,67 @@ func (g *igdb) GetReleaseDatesByIDs(ids []uint64) ([]*pb.ReleaseDate, error) { return g.GetReleaseDates(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetReleaseDates(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where platform = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetReleaseDates(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where release_region = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetReleaseDates(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where status = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetReleaseDates(idStr) +} diff --git a/screenshots.go b/screenshots.go index 51877de..ab7f306 100644 --- a/screenshots.go +++ b/screenshots.go @@ -45,3 +45,19 @@ func (g *igdb) GetScreenshotsByIDs(ids []uint64) ([]*pb.Screenshot, error) { return g.GetScreenshots(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetScreenshots(idStr) +} diff --git a/websites.go b/websites.go index 2c3f99c..ac13150 100644 --- a/websites.go +++ b/websites.go @@ -45,3 +45,35 @@ func (g *igdb) GetWebsitesByIDs(ids []uint64) ([]*pb.Website, error) { return g.GetWebsites(idStr) } + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where game = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetWebsites(idStr) +} + +func (g *igdb) 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) { + idStrSlice := make([]string, len(ids)) + for i, id := range ids { + idStrSlice[i] = fmt.Sprintf("%d", id) + } + + idStr := fmt.Sprintf(`where type = (%s); fields *;`, strings.Join(idStrSlice, ",")) + + return g.GetWebsites(idStr) +}