Currently, this component is used by QuickSearch dialog. And then, it will be
used by the "Add to playlist" dialog.
I added some setters and getters to the QuickSearch dialog to abstract the interaction
between QuickSearch and SearchDialog from the Controller.
After this PR, I will implement the 'Add to playlist' dialog to incorporate the SearchDialog.
Remove custom page implementation for Artists, and instead rely on the
generic `GridView` approach. This also simplifies adding new
sorting/filtering options as next improvements.
The new `ArtistFilter` is a dummy implementation without any real
filters at the moment.
Also, the `go-jellyfin` upgrade is needed to correctly display the album
count for each artist.
For the scenarios where both `Filter` and `Map` are being applied,
having this util should be faster, as it avoids the creation of an extra
slice during the intermediate step.
Having a `slices.Contains` check within a `for` loop has a complexity of
`O(n*m)`, with a worst case scenario of `O(n^2)` for when both
collections have the same size.
This is because `slices.Contains` internally runs just a regular loop,
checking for equality element by element.
Instead, this diff changes every occurence of this pattern to converting
the collection we compare against to a set, and then running a faster
lookup against it.
The Grid view and related components were highly coupled to Albums,
including the filter button that is currently used only for album
filtering.
As part of the migration of Artists to Grid view, this is the smallest
possible change to convert many of the existing code to
generics/interfaces that will allow different media to be displayed and
filtered by using Grid views.
The main changes in this diff are:
* Introduction of generics for Media types (`M`) and Filter options
(`F`), which can be later extended to other entities besides Albums.
* Complete decoupling of `GridViewPage` and related components from
Albums (making these pages also generic).
* Refactoring of Subsonic/Jellyfin specific code to understand these new
generics when dealing with filtering logic.