mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-23 18:39:46 +01:00
fix(pglite): compare starred as a boolean in annotation filters
The starred filter used COALESCE(starred, 0) > 0, which PostgreSQL
rejects for a boolean column ('COALESCE types boolean and integer cannot
be matched'); the Favourites lists returned 500.
This commit is contained in:
parent
01cb20817c
commit
61f7934a3b
1 changed files with 1 additions and 4 deletions
|
|
@ -95,10 +95,7 @@ func annotationBoolFilter(field string) func(string, any) Sqlizer {
|
|||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if strings.ToLower(v) == "true" {
|
||||
return Expr(fmt.Sprintf("COALESCE(%s, 0) > 0", field))
|
||||
}
|
||||
return Expr(fmt.Sprintf("COALESCE(%s, 0) = 0", field))
|
||||
return Expr(fmt.Sprintf("COALESCE(%s, false) = %t", field, strings.ToLower(v) == "true"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue