diff --git a/persistence/album_repository.go b/persistence/album_repository.go index a0a92f7ee..37469d27d 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -57,6 +57,7 @@ func NewAlbumRepository(ctx context.Context, db dbx.Builder) model.AlbumReposito r := &albumRepository{} r.ctx = ctx r.db = db + r.tableName = "album" r.registerModel(&model.Album{}, map[string]filterFunc{ "id": idFilter(r.tableName), "name": fullTextFilter, @@ -66,6 +67,7 @@ func NewAlbumRepository(ctx context.Context, db dbx.Builder) model.AlbumReposito "recently_played": recentlyPlayedFilter, "starred": booleanFilter, "has_rating": hasRatingFilter, + "genre_id": eqFilter, }) if conf.Server.PreferSortTags { r.sortMappings = map[string]string{ diff --git a/persistence/artist_repository.go b/persistence/artist_repository.go index 617fcb6df..8f41a4f7a 100644 --- a/persistence/artist_repository.go +++ b/persistence/artist_repository.go @@ -59,10 +59,12 @@ func NewArtistRepository(ctx context.Context, db dbx.Builder) model.ArtistReposi r.ctx = ctx r.db = db r.indexGroups = utils.ParseIndexGroups(conf.Server.IndexGroups) + r.tableName = "artist" // To be used by the idFilter below r.registerModel(&model.Artist{}, map[string]filterFunc{ - "id": idFilter(r.tableName), - "name": fullTextFilter, - "starred": booleanFilter, + "id": idFilter(r.tableName), + "name": fullTextFilter, + "starred": booleanFilter, + "genre_id": eqFilter, }) if conf.Server.PreferSortTags { r.sortMappings = map[string]string{ diff --git a/persistence/mediafile_repository.go b/persistence/mediafile_repository.go index 584b381f8..6c6380b59 100644 --- a/persistence/mediafile_repository.go +++ b/persistence/mediafile_repository.go @@ -24,10 +24,12 @@ func NewMediaFileRepository(ctx context.Context, db dbx.Builder) *mediaFileRepos r := &mediaFileRepository{} r.ctx = ctx r.db = db + r.tableName = "media_file" r.registerModel(&model.MediaFile{}, map[string]filterFunc{ - "id": idFilter(r.tableName), - "title": fullTextFilter, - "starred": booleanFilter, + "id": idFilter(r.tableName), + "title": fullTextFilter, + "starred": booleanFilter, + "genre_id": eqFilter, }) if conf.Server.PreferSortTags { r.sortMappings = map[string]string{