mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 04:00:38 +03:00
Coalesce null annotation values, to better rank them against annotations with value 0
This commit is contained in:
parent
cdccdc56c9
commit
595186b1b2
@ -19,7 +19,13 @@ func (r sqlRepository) newSelectWithAnnotation(idField string, options ...model.
|
||||
"annotation.item_id = "+idField+
|
||||
" AND annotation.item_type = '"+r.tableName+"'"+
|
||||
" AND annotation.user_id = '"+userId(r.ctx)+"')").
|
||||
Columns("starred", "starred_at", "play_count", "play_date", "rating")
|
||||
Columns(
|
||||
"coalesce(starred, 0) as starred",
|
||||
"coalesce(rating, 0) as rating",
|
||||
"coalesce(play_count, 0) as play_count",
|
||||
"starred_at",
|
||||
"play_date",
|
||||
)
|
||||
}
|
||||
|
||||
func (r sqlRepository) annId(itemID ...string) And {
|
||||
|
Loading…
x
Reference in New Issue
Block a user