misc: Implement Iterator approach for artists

First step towards improving sorting for Artists. Use the same iterator
approach as albums and tracks.
This commit is contained in:
Michael Manganiello
2024-03-06 00:54:16 -03:00
parent 50980e7d56
commit 2cb002dde0
7 changed files with 140 additions and 30 deletions
+7 -1
View File
@@ -42,6 +42,10 @@ func (f AlbumFilter) Matches(album *Album) bool {
return genresMatch(f.Genres, album.Genres)
}
type ArtistIterator interface {
Next() *Artist
}
type AlbumIterator interface {
Next() *Album
}
@@ -103,7 +107,9 @@ type MediaProvider interface {
GetSimilarTracks(artistID string, count int) ([]*Track, error)
GetArtists() ([]*Artist, error)
ArtistSortOrders() []string
IterateArtists(sortOrder string) ArtistIterator
GetGenres() ([]*Genre, error)