Fix fields not being sent on getPlaylist.view responses.

This commit is contained in:
caiocotts 2024-01-25 19:59:18 -05:00 committed by Caio Cotts
parent 67c82f524b
commit 58218e6dc4
2 changed files with 6 additions and 6 deletions

View File

@ -345,11 +345,11 @@ func (r *playlistRepository) refreshCounters(pls *model.Playlist) error {
func (r *playlistRepository) loadTracks(sel SelectBuilder, id string) (model.PlaylistTracks, error) {
tracksQuery := sel.
Columns(
"coalesce(starred, 0)",
"coalesce(starred, 0) as starred",
"starred_at",
"coalesce(play_count, 0)",
"coalesce(play_count, 0) as play_count",
"play_date",
"coalesce(rating, 0)",
"coalesce(rating, 0) as rating",
"f.*",
"playlist_tracks.*",
).

View File

@ -51,9 +51,9 @@ func (r *playlistTrackRepository) Read(id string) (interface{}, error) {
" AND annotation.item_type = 'media_file'"+
" AND annotation.user_id = '"+userId(r.ctx)+"')").
Columns(
"coalesce(starred, 0)",
"coalesce(play_count, 0)",
"coalesce(rating, 0)",
"coalesce(starred, 0) as starred",
"coalesce(play_count, 0) as play_count",
"coalesce(rating, 0) as rating",
"starred_at",
"play_date",
"f.*",