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.
Upgrade to 1.21 as 1.20 is now unmaintained.
Most changes are related to the new `slices` package from standard
library, which can replace some existing custom functions.
This feature is only available on the Subsonic media provider. Using a
Jellyfin server will make Supersonic hide the "Share" option.
* Artists: Option available in grid view and in Artist view.
* Albums: Option available in grid view and in Album view.
* Tracks: Option available in tracklist, when a single track is selected.