Skip to content

Commit

Permalink
Fix getRandomSongs filters
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Apr 19, 2020
1 parent 3b7d7bd commit f83d0d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/list_generator.go
Expand Up @@ -89,13 +89,13 @@ func SongsByRandom(genre string, fromYear, toYear int) ListFilter {
}
ff := squirrel.And{}
if genre != "" {
options.Filters = append(ff, squirrel.Eq{"genre": genre})
ff = append(ff, squirrel.Eq{"genre": genre})
}
if fromYear != 0 {
options.Filters = append(ff, squirrel.GtOrEq{"year": fromYear})
ff = append(ff, squirrel.GtOrEq{"year": fromYear})
}
if toYear != 0 {
options.Filters = append(ff, squirrel.LtOrEq{"year": toYear})
ff = append(ff, squirrel.LtOrEq{"year": toYear})
}
options.Filters = ff
return options
Expand Down

0 comments on commit f83d0d4

Please sign in to comment.