A search that asks for no media is answered with media #58
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/Search/Hints?includeMedia=falseis ignored.Upstream answers nothing: it restricts
IncludeItemTypesto the by-name kinds,and none of those survives the access filter. This server answers with the full
media result.
Found while fixing #55 and #56, present on main before either, and orthogonal to
both — it is about which kinds a search may return rather than which library
it looks in or which columns it matches.
A search asked for no media now answers with the names alone.
SearchManager.BuildIncludeItemTypes(SearchManager.cs:416) leaves therequest's kinds untouched while
IncludeMediais on. With it off, it adds theby-name kinds the other flags allow —
Genre+MusicGenre,Person,Studio,MusicArtist— each only while the list so far names nothing or names thatkind. None of those is filed under a library, so the access filter drops every
one and the answer is empty.
Two details that a plausible reading gets wrong, and that measuring caught:
IsEmptyOrContains([Movie], Genre)is false, so nothing is added and the list stays[Movie]— a searchfor movies with media off is still a search for movies, answering 3 here, not
everything. My first implementation emptied the list and answered 7.
Genreis added to an empty list,IsEmptyOrContainsis false forPerson,StudioandMusicArtist, so theyare never reached. The first kind added closes the door on the rest.
Verified live against upstream over a production database, 11 of 11 including
the ordering:
alien&includeMedia=falserock&includeMedia=falsealien&includeMedia=false&includeItemTypes=Movielove&includeMedia=false&includeItemTypes=Episodealien&includeMedia=true/ bare