Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Filter by Name for GameVideos #106

Open
HammerMeetNail opened this issue May 25, 2021 · 2 comments
Open

Unable to Filter by Name for GameVideos #106

HammerMeetNail opened this issue May 25, 2021 · 2 comments

Comments

@HammerMeetNail
Copy link

There might be an issue filtering by non-id fields for GameVideos.Index().

Querying the IGDB API https://api.igdb.com/v4/game_videos directly with the following body yields a single item.

Body:

fields name,video_id;
where id = 48965;
limit 500;
offset 0;

Response:

[
    {
        "id": 48965,
        "name": "Announcement Trailer",
        "video_id": "61-OMrOxyso"
    }
]

Querying by name instead of id yields a response with multiple items:

Body:

fields name,video_id;
where name = ("Announcement Trailer");
limit 500;
offset 0;

When using this library, filtering by ID works but not by Name.
Works:

options := igdb.ComposeOptions(
		igdb.SetLimit(500),
		igdb.SetOffset(0),
		igdb.SetFields("name, video_id"),
		igdb.SetFilter("id", igdb.OpContainsAtLeast, "48965"),
	)

videos, err := IGDB.GameVideos.Index(options)

Doesn't Work:

options := igdb.ComposeOptions(
		igdb.SetLimit(limit),
		igdb.SetOffset(offset),
		igdb.SetFields("name, video_id"),
		igdb.SetFilter("name", igdb.OpContainsAtLeast, "Announcement Trailer"),
	)

videos, err := IGDB.GameVideos.Index(options)

We get the following error with the above request:
Error: cannot get index of GameVideos: cannot make POST request: igdb server error: status: 400 message: bad request: check query parameters

Any thoughts on how we can fix this?

Thanks!

@Akecel
Copy link

Akecel commented Mar 31, 2023

@HammerMeetNail Hello !
I got the same error for Company (filter by name), any news about that ? Did you find a trick ?

@HammerMeetNail
Copy link
Author

@Akecel it's been awhile, but I recall just forking the repo and updating the struct. Love this project, but I think at this point it's been abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants