Skip to content

Commit

Permalink
fix(subsonic): return song artist ID, album and song genres from by t…
Browse files Browse the repository at this point in the history
…ag views

related: #229
  • Loading branch information
sentriz committed Jul 21, 2022
1 parent 4557a4e commit 840c5bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/ctrlsubsonic/handlers_by_tags.go
Expand Up @@ -10,11 +10,11 @@ import (

"github.com/jinzhu/gorm"

"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/scrobble/lastfm"
"go.senan.xyz/gonic/server/ctrlsubsonic/params"
"go.senan.xyz/gonic/server/ctrlsubsonic/spec"
"go.senan.xyz/gonic/server/ctrlsubsonic/specid"
"go.senan.xyz/gonic/db"
"go.senan.xyz/gonic/scrobble/lastfm"
)

func (c *Controller) ServeGetArtists(r *http.Request) *spec.Response {
Expand Down Expand Up @@ -211,6 +211,7 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response {
var albums []*db.Album
q = c.DB.
Preload("TagArtist").
Preload("Genres").
Where("tag_title LIKE ? OR tag_title_u_dec LIKE ?", query, query).
Offset(params.GetOrInt("albumOffset", 0)).
Limit(params.GetOrInt("albumCount", 20))
Expand All @@ -228,6 +229,8 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response {
var tracks []*db.Track
q = c.DB.
Preload("Album").
Preload("Album.TagArtist").
Preload("Genres").
Where("tag_title LIKE ? OR tag_title_u_dec LIKE ?", query, query).
Offset(params.GetOrInt("songOffset", 0)).
Limit(params.GetOrInt("songCount", 20))
Expand Down

0 comments on commit 840c5bc

Please sign in to comment.