u
This commit is contained in:
@@ -35,9 +35,5 @@ func (a *AgeRatingCategories) Query(ctx context.Context, query string) ([]*pb.Ag
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcategories) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcategories, nil
|
return data.Ageratingcategories, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *AgeRatingContentDescriptions) Query(ctx context.Context, query string)
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcontentdescriptions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcontentdescriptions, nil
|
return data.Ageratingcontentdescriptions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *AgeRatingContentDescriptionsV2) Query(ctx context.Context, query string
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcontentdescriptionsv2) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcontentdescriptionsv2, nil
|
return data.Ageratingcontentdescriptionsv2, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *AgeRatingOrganizations) Query(ctx context.Context, query string) ([]*pb
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingorganizations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingorganizations, nil
|
return data.Ageratingorganizations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *AgeRatings) Query(ctx context.Context, query string) ([]*pb.AgeRating,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratings) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratings, nil
|
return data.Ageratings, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *AlternativeNames) Query(ctx context.Context, query string) ([]*pb.Alter
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Alternativenames) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Alternativenames, nil
|
return data.Alternativenames, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Artworks) Query(ctx context.Context, query string) ([]*pb.Artwork, erro
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Artworks) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Artworks, nil
|
return data.Artworks, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CharacterGenders) Query(ctx context.Context, query string) ([]*pb.Chara
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Charactergenders) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Charactergenders, nil
|
return data.Charactergenders, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CharacterMugShots) Query(ctx context.Context, query string) ([]*pb.Char
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Charactermugshots) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Charactermugshots, nil
|
return data.Charactermugshots, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CharacterSpecies) Query(ctx context.Context, query string) ([]*pb.Chara
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Characterspecies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Characterspecies, nil
|
return data.Characterspecies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Characters) Query(ctx context.Context, query string) ([]*pb.Character,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Characters) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Characters, nil
|
return data.Characters, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CollectionMembershipTypes) Query(ctx context.Context, query string) ([]
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionmembershiptypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionmembershiptypes, nil
|
return data.Collectionmembershiptypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CollectionMemberships) Query(ctx context.Context, query string) ([]*pb.
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionmemberships) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionmemberships, nil
|
return data.Collectionmemberships, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CollectionRelationTypes) Query(ctx context.Context, query string) ([]*p
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionrelationtypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionrelationtypes, nil
|
return data.Collectionrelationtypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CollectionRelations) Query(ctx context.Context, query string) ([]*pb.Co
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionrelations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionrelations, nil
|
return data.Collectionrelations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CollectionTypes) Query(ctx context.Context, query string) ([]*pb.Collec
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectiontypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectiontypes, nil
|
return data.Collectiontypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Collections) Query(ctx context.Context, query string) ([]*pb.Collection
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collections) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collections, nil
|
return data.Collections, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package endpoint
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
@@ -36,9 +35,5 @@ func (a *Companies) Query(ctx context.Context, query string) ([]*pb.Company, err
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companies) == 0 {
|
|
||||||
return nil, errors.New("no results")
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companies, nil
|
return data.Companies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CompanyLogos) Query(ctx context.Context, query string) ([]*pb.CompanyLo
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companylogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companylogos, nil
|
return data.Companylogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CompanyStatuses) Query(ctx context.Context, query string) ([]*pb.Compan
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companystatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companystatuses, nil
|
return data.Companystatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *CompanyWebsites) Query(ctx context.Context, query string) ([]*pb.Compan
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companywebsites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companywebsites, nil
|
return data.Companywebsites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Covers) Query(ctx context.Context, query string) ([]*pb.Cover, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Covers) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Covers, nil
|
return data.Covers, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *DateFormats) Query(ctx context.Context, query string) ([]*pb.DateFormat
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Dateformats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Dateformats, nil
|
return data.Dateformats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *EventLogos) Query(ctx context.Context, query string) ([]*pb.EventLogo,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Eventlogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Eventlogos, nil
|
return data.Eventlogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *EventNetworks) Query(ctx context.Context, query string) ([]*pb.EventNet
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Eventnetworks) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Eventnetworks, nil
|
return data.Eventnetworks, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Events) Query(ctx context.Context, query string) ([]*pb.Event, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Events) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Events, nil
|
return data.Events, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *ExternalGameSources) Query(ctx context.Context, query string) ([]*pb.Ex
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Externalgamesources) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Externalgamesources, nil
|
return data.Externalgamesources, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *ExternalGames) Query(ctx context.Context, query string) ([]*pb.External
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Externalgames) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Externalgames, nil
|
return data.Externalgames, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Franchises) Query(ctx context.Context, query string) ([]*pb.Franchise,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Franchises) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Franchises, nil
|
return data.Franchises, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameEngineLogos) Query(ctx context.Context, query string) ([]*pb.GameEn
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameenginelogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameenginelogos, nil
|
return data.Gameenginelogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameEngines) Query(ctx context.Context, query string) ([]*pb.GameEngine
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameengines) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameengines, nil
|
return data.Gameengines, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameLocalizations) Query(ctx context.Context, query string) ([]*pb.Game
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamelocalizations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamelocalizations, nil
|
return data.Gamelocalizations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameModes) Query(ctx context.Context, query string) ([]*pb.GameMode, er
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamemodes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamemodes, nil
|
return data.Gamemodes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameReleaseFormats) Query(ctx context.Context, query string) ([]*pb.Gam
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamereleaseformats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamereleaseformats, nil
|
return data.Gamereleaseformats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameStatuses) Query(ctx context.Context, query string) ([]*pb.GameStatu
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamestatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamestatuses, nil
|
return data.Gamestatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameTimeToBeats) Query(ctx context.Context, query string) ([]*pb.GameTi
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gametimetobeats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gametimetobeats, nil
|
return data.Gametimetobeats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameTypes) Query(ctx context.Context, query string) ([]*pb.GameType, er
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gametypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gametypes, nil
|
return data.Gametypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameVersionFeatureValues) Query(ctx context.Context, query string) ([]*
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversionfeaturevalues) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversionfeaturevalues, nil
|
return data.Gameversionfeaturevalues, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameVersionFeatures) Query(ctx context.Context, query string) ([]*pb.Ga
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversionfeatures) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversionfeatures, nil
|
return data.Gameversionfeatures, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameVersions) Query(ctx context.Context, query string) ([]*pb.GameVersi
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversions, nil
|
return data.Gameversions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *GameVideos) Query(ctx context.Context, query string) ([]*pb.GameVideo,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamevideos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamevideos, nil
|
return data.Gamevideos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Games) Query(ctx context.Context, query string) ([]*pb.Game, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Games) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Games, nil
|
return data.Games, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Genres) Query(ctx context.Context, query string) ([]*pb.Genre, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Genres) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Genres, nil
|
return data.Genres, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *InvolvedCompanies) Query(ctx context.Context, query string) ([]*pb.Invo
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Involvedcompanies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Involvedcompanies, nil
|
return data.Involvedcompanies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Keywords) Query(ctx context.Context, query string) ([]*pb.Keyword, erro
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Keywords) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Keywords, nil
|
return data.Keywords, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *LanguageSupportTypes) Query(ctx context.Context, query string) ([]*pb.L
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languagesupporttypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languagesupporttypes, nil
|
return data.Languagesupporttypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *LanguageSupports) Query(ctx context.Context, query string) ([]*pb.Langu
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languagesupports) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languagesupports, nil
|
return data.Languagesupports, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Languages) Query(ctx context.Context, query string) ([]*pb.Language, er
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languages) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languages, nil
|
return data.Languages, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *MultiplayerModes) Query(ctx context.Context, query string) ([]*pb.Multi
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Multiplayermodes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Multiplayermodes, nil
|
return data.Multiplayermodes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *NetworkTypes) Query(ctx context.Context, query string) ([]*pb.NetworkTy
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Networktypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Networktypes, nil
|
return data.Networktypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformFamilies) Query(ctx context.Context, query string) ([]*pb.Platf
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformfamilies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformfamilies, nil
|
return data.Platformfamilies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformLogos) Query(ctx context.Context, query string) ([]*pb.Platform
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformlogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformlogos, nil
|
return data.Platformlogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformTypes) Query(ctx context.Context, query string) ([]*pb.Platform
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformtypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformtypes, nil
|
return data.Platformtypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformVersionCompanies) Query(ctx context.Context, query string) ([]*
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversioncompanies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversioncompanies, nil
|
return data.Platformversioncompanies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformVersionReleaseDates) Query(ctx context.Context, query string) (
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversionreleasedates) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversionreleasedates, nil
|
return data.Platformversionreleasedates, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformVersions) Query(ctx context.Context, query string) ([]*pb.Platf
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversions, nil
|
return data.Platformversions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlatformWebsites) Query(ctx context.Context, query string) ([]*pb.Platf
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformwebsites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformwebsites, nil
|
return data.Platformwebsites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,5 @@ func (a *Platforms) Query(ctx context.Context, query string) ([]*pb.Platform, er
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platforms) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
return data.Platforms, nil
|
return data.Platforms, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PlayerPerspectives) Query(ctx context.Context, query string) ([]*pb.Pla
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Playerperspectives) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Playerperspectives, nil
|
return data.Playerperspectives, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PopularityPrimitives) Query(ctx context.Context, query string) ([]*pb.P
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Popularityprimitives) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Popularityprimitives, nil
|
return data.Popularityprimitives, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *PopularityTypes) Query(ctx context.Context, query string) ([]*pb.Popula
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Popularitytypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Popularitytypes, nil
|
return data.Popularitytypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Regions) Query(ctx context.Context, query string) ([]*pb.Region, error)
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Regions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Regions, nil
|
return data.Regions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *ReleaseDateRegions) Query(ctx context.Context, query string) ([]*pb.Rel
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedateregions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedateregions, nil
|
return data.Releasedateregions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *ReleaseDateStatuses) Query(ctx context.Context, query string) ([]*pb.Re
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedatestatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedatestatuses, nil
|
return data.Releasedatestatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *ReleaseDates) Query(ctx context.Context, query string) ([]*pb.ReleaseDa
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedates) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedates, nil
|
return data.Releasedates, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Screenshots) Query(ctx context.Context, query string) ([]*pb.Screenshot
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Screenshots) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Screenshots, nil
|
return data.Screenshots, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,10 +46,6 @@ func (a *Search) Search(ctx context.Context, query string) ([]*pb.Search, error)
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Searches) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Searches, nil
|
return data.Searches, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Themes) Query(ctx context.Context, query string) ([]*pb.Theme, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Themes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Themes, nil
|
return data.Themes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *WebsiteTypes) Query(ctx context.Context, query string) ([]*pb.WebsiteTy
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Websitetypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Websitetypes, nil
|
return data.Websitetypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,5 @@ func (a *Websites) Query(ctx context.Context, query string) ([]*pb.Website, erro
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Websites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Websites, nil
|
return data.Websites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user