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