Add `has_rating` filter to albums
This commit is contained in:
parent
10dcc3fb37
commit
5178f44094
|
@ -44,6 +44,7 @@ func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepository
|
|||
"year": yearFilter,
|
||||
"recently_played": recentlyPlayedFilter,
|
||||
"starred": booleanFilter,
|
||||
"has_rating": hasRatingFilter,
|
||||
}
|
||||
|
||||
return r
|
||||
|
@ -60,6 +61,10 @@ func recentlyPlayedFilter(field string, value interface{}) Sqlizer {
|
|||
return Gt{"play_count": 0}
|
||||
}
|
||||
|
||||
func hasRatingFilter(field string, value interface{}) Sqlizer {
|
||||
return Gt{"rating": 0}
|
||||
}
|
||||
|
||||
func yearFilter(field string, value interface{}) Sqlizer {
|
||||
return Or{
|
||||
And{
|
||||
|
|
Loading…
Reference in New Issue