Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

GetSearchHintsAsync seems to ignore the IncludeItemTypes array in SearchQuery #41

Open
tanathos opened this issue Apr 15, 2018 · 5 comments

Comments

@tanathos
Copy link
Contributor

tanathos commented Apr 15, 2018

I've already opened this issue in the Emby repository, but probably this is the best place.

As for the title: I'm building a search query via the C# client that looks like this:

SearchQuery searchQuery = new SearchQuery();
searchQuery.UserId = client.CurrentUserId;
searchQuery.IncludeArtists = false;
searchQuery.IncludeGenres = false;
searchQuery.IncludePeople = false;
searchQuery.IncludeStudios = false;
searchQuery.IncludeMedia = true;
searchQuery.SearchTerm = "Iron";
searchQuery.IncludeItemTypes = new string[] { "MusicAlbum" };
searchQuery.Limit = 24;

var res = await client.GetSearchHintsAsync(searchQuery);

But in the SearchHints results I don't only have music albums with the search term "Iron", but also songs.

I'm trying different configurations of the query, also with the ExcludeItemTypes, but I always get items of all types...

@ebr11
Copy link
Member

ebr11 commented Apr 16, 2018

Hi. Try not setting IncludeMedia to true.

@tanathos
Copy link
Contributor Author

tanathos commented Apr 16, 2018

Done, still getting mixed album/audio media type...

Edit: if it can be usefull, I'm connecting to a server v 3.2.60.0 on QNAP

@tanathos
Copy link
Contributor Author

...no news on this?

@LukePulverenti
Copy link
Member

Hi, can you use the Chrome debugger to compare to the web app to see what is missing? thanks.

@tanathos
Copy link
Contributor Author

Already tried, the web interface builds the query in this way:
http://192.168.2.221:8096/emby/Search/Hints?searchTerm=Iron&IncludePeople=false&IncludeMedia=true&IncludeGenres=false&IncludeStudios=false&IncludeArtists=false&IncludeItemTypes=MusicAlbum&UserId=8c5b133ef4f1452d8d847cbac19ba08e&Limit=24&ParentId=7e64e319657a9516ec78490da03edccb

the parsed querystring parameters are these:

searchTerm: Iron
IncludePeople: false
IncludeMedia: true
IncludeGenres: false
IncludeStudios: false
IncludeArtists: false
IncludeItemTypes: MusicAlbum
UserId: 8c5b133ef4f1452d8d847cbac19ba08e
Limit: 24
ParentId: 7e64e319657a9516ec78490da03edccb

The only noticeable difference is the ParentId, but event with my results are mixed: I receive both Audio and MusicAlbum items (also one Episode).

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

No branches or pull requests

3 participants