Skip to content

🎧 Your Personal Streaming Service

Fix Artist filtering

Deluan7819e834c8dd
diff --git a/persistence/artist_repository.go b/persistence/artist_repository.go
index a8b89b423..ece0dbeaf 100644
--- a/persistence/artist_repository.go
+++ b/persistence/artist_repository.go
@@ -84,7 +84,7 @@ func (r *artistRepository) GetAll(options ...model.QueryOptions) (model.Artists,
}
func (r *artistRepository) toModels(dba []dbArtist) model.Artists {
- var res model.Artists
+ res := model.Artists{}
for i := range dba {
a := dba[i]
res = append(res, *r.toModel(&a))
diff --git a/persistence/sql_restful.go b/persistence/sql_restful.go
index 13a7433ca..78c2ad121 100644
--- a/persistence/sql_restful.go
+++ b/persistence/sql_restful.go
@@ -21,6 +21,9 @@ func (r sqlRestful) parseRestFilters(options rest.QueryOptions) Sqlizer {
}
filters := And{}
for f, v := range options.Filters {
+ if v == "" {
+ continue
+ }
if ff, ok := r.filterMappings[f]; ok {
filters = append(filters, ff(f, v))
} else if f == "id" {