Fix getRandomSongs filters
This commit is contained in:
parent
3b7d7bdb04
commit
f83d0d471d
1 changed files with 3 additions and 3 deletions
|
|
@ -89,13 +89,13 @@ func SongsByRandom(genre string, fromYear, toYear int) ListFilter {
|
||||||
}
|
}
|
||||||
ff := squirrel.And{}
|
ff := squirrel.And{}
|
||||||
if genre != "" {
|
if genre != "" {
|
||||||
options.Filters = append(ff, squirrel.Eq{"genre": genre})
|
ff = append(ff, squirrel.Eq{"genre": genre})
|
||||||
}
|
}
|
||||||
if fromYear != 0 {
|
if fromYear != 0 {
|
||||||
options.Filters = append(ff, squirrel.GtOrEq{"year": fromYear})
|
ff = append(ff, squirrel.GtOrEq{"year": fromYear})
|
||||||
}
|
}
|
||||||
if toYear != 0 {
|
if toYear != 0 {
|
||||||
options.Filters = append(ff, squirrel.LtOrEq{"year": toYear})
|
ff = append(ff, squirrel.LtOrEq{"year": toYear})
|
||||||
}
|
}
|
||||||
options.Filters = ff
|
options.Filters = ff
|
||||||
return options
|
return options
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue