feat: show year range in album view and match ranges in year filter. #118
This commit is contained in:
@@ -29,11 +29,23 @@ func NewAlbumRepository(ctx context.Context, o orm.Ormer) model.AlbumRepository
|
||||
"name": fullTextFilter,
|
||||
"compilation": booleanFilter,
|
||||
"artist_id": artistFilter,
|
||||
"year": yearFilter,
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
func yearFilter(field string, value interface{}) Sqlizer {
|
||||
return Or{
|
||||
And{
|
||||
Gt{"min_year": 0},
|
||||
LtOrEq{"min_year": value},
|
||||
GtOrEq{"max_year": value},
|
||||
},
|
||||
Eq{"max_year": value},
|
||||
}
|
||||
}
|
||||
|
||||
func artistFilter(field string, value interface{}) Sqlizer {
|
||||
return Exists("media_file", And{
|
||||
ConcatExpr("album_id=album.id"),
|
||||
|
||||
Reference in New Issue
Block a user